/* mygem.ge — collection toolbar + list-view cards. Site tokens: white cards, soft borders, navy (#000080). Load after style.css */

/* toolbar */
.sbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; padding: 12px 16px; background: var(--card-bg); border: 1px solid var(--card-bd); border-radius: var(--card-r); box-shadow: var(--card-sh); position: relative; z-index: 5; }
.sbar h2 { margin: 0; font-size: var(--fs-lg); font-weight: 500; color: var(--tx); }
.sbar h2 b { font-weight: 600; color: var(--btn); }
.sctl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sctl .ddw { min-width: 180px; }
.sctl .dd-btn { height: 40px; font-size: var(--fs-md); border-radius: var(--r); }
.sctl .dd.open .dd-btn, .sctl .dd-btn:focus-visible { border-color: var(--btn); box-shadow: 0 0 0 3px rgba(0, 0, 128, 0.15); }
.sctl .dd-list { min-width: 100%; width: max-content; left: auto; right: 0; }
.sctl .dd-opt.sel { background: #E8E8F7; color: var(--btn); }
.vtog { display: flex; align-items: center; gap: 4px; }
.vtog button { width: 36px; height: 36px; border: 0; border-radius: var(--r); background: none; color: #9AA0A6; cursor: pointer; display: grid; place-items: center; transition: background 0.2s, color 0.2s; }
.vtog button svg { width: 20px; height: 20px; }
.vtog button:hover { background: var(--hov); color: var(--tx); }
.vtog button.on { color: var(--btn); background: #E8E8F7; }
.vtog button:focus-visible { outline: 3px solid rgba(0, 0, 128, 0.35); outline-offset: 2px; }

/* list view: horizontal card (photo | details + specs | location, price) */
.lgrid { display: flex; flex-direction: column; gap: 14px; }
.lcard { display: flex; gap: 20px; padding: 12px; background: var(--card-bg); border: 1px solid var(--card-bd); border-radius: 20px; box-shadow: var(--card-sh); cursor: pointer; transition: border-color 0.25s, box-shadow 0.25s; }
.lcard:hover { border-color: #D3D3EE; box-shadow: 0 8px 22px rgba(17, 24, 39, 0.10); }
.lcard:focus-visible { outline: 3px solid rgba(0, 0, 128, 0.35); outline-offset: 2px; }
.limg { position: relative; flex: 0 0 240px; align-self: flex-start; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: linear-gradient(160deg, #EEF0F2, #E3E4E6); }
.limgi { position: absolute; inset: 0; display: grid; place-items: center; background-size: contain !important; background-repeat: no-repeat !important; background-position: center !important; color: var(--gold); transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.limgi svg.ill { width: 38%; height: auto; opacity: 0.8; }
@media (hover: hover) and (pointer: fine) { .lcard:hover .limgi { transform: scale(1.04); } }

.lbody { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main side" "foot side"; grid-template-rows: 1fr auto; gap: 12px 24px; padding: 2px 6px 2px 0; }
.lmain { grid-area: main; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.ltitle { margin: 0; font-size: var(--fs-xl); font-weight: 600; line-height: 1.3; color: var(--tx); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lmain .pstat { margin-top: 0; }
.lspecs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; }
.lsp { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: var(--fs-base); color: #4B5563; }
.lsp svg { flex: none; width: 20px; height: 20px; color: #9AA0A6; }
.lsp span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lside { grid-area: side; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; min-width: 150px; }
.ltop { display: flex; align-items: center; gap: 14px; font-size: var(--fs-md); }
.lloc { color: var(--tx); }
.lcond { color: #2FA66A; font-weight: 500; }
.lcard .cact { flex: none; width: 30px; height: 30px; border: 0; background: transparent; backdrop-filter: none; box-shadow: none; color: var(--tx); margin-right: -4px; }
.lcard .cact svg.ic { width: 20px; height: 20px; }
.lcard .cact:hover { background: transparent; box-shadow: none; color: var(--err); }
.lprice { display: flex; align-items: center; gap: 10px; }
.lprice .price { font-size: 24px; font-weight: 600; }
.lprice .price.nego { font-size: var(--fs-lg); }
.lside .stks { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 260px; }
.lside .stk { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid #E3E4E6; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(17, 24, 39, 0.08); color: #2B3138; font-size: var(--fs-xs); font-weight: 500; line-height: 1.2; white-space: nowrap; }
.lside .stk .se { font-size: 14px; line-height: 1; }
.lside .stk b { font-weight: 500; }

.lfoot { grid-area: foot; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: var(--fs-sm); color: #8A9099; }
.lvip { padding: 4px 10px; border-radius: 8px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.3px; color: #fff; line-height: 1.3; }
.lvip.s { background: #F4511E; }
.lvip.v { background: var(--btn); }
.lfoot .vw { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); color: #8A9099; }
.lfoot .vw .ic { width: 14px; height: 14px; }

@media (max-width: 900px) {
  .limg { flex-basis: 180px; }
  .lprice .price { font-size: 20px; }
}
@media (max-width: 700px) {
  .sbar { padding: 10px 12px; }
  .sctl { width: 100%; justify-content: space-between; }
  .sctl .ddw { min-width: 0; flex: 1 1 120px; }
  .lcard { gap: 12px; padding: 10px; border-radius: 16px; }
  .limg { flex-basis: 120px; aspect-ratio: 1 / 1; }
  .lbody { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "side" "foot"; grid-template-rows: auto; gap: 8px; padding: 0; }
  .ltitle { font-size: var(--fs-base); }
  .lspecs { grid-template-columns: 1fr; gap: 6px; }
  .lsp { font-size: var(--fs-md); }
  .lside { align-items: flex-start; flex-direction: row; flex-wrap: wrap; justify-content: space-between; min-width: 0; gap: 8px; }
  .ltop { order: 2; margin-left: auto; }
  .lprice { order: 1; }
  .lside .stks { order: 3; justify-content: flex-start; max-width: none; flex-basis: 100%; }
}

/* grid card tags: same svg icons as the list card */
.card .tg svg { flex: none; width: 14px; height: 14px; color: #9AA0A6; }

/* pagination (15 per page) */
.pager { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 28px 0 8px; }
.pgb { min-width: 40px; height: 40px; padding: 0 10px; border: 1px solid var(--cream2); border-radius: var(--r); background: #fff; color: var(--tx); font: inherit; font-size: var(--fs-base); font-weight: 500; cursor: pointer; display: inline-grid; place-items: center; transition: background 0.2s, border-color 0.2s, color 0.2s; }
.pgb svg { width: 18px; height: 18px; }
.pgb:hover:not(:disabled):not(.on) { background: var(--hov); border-color: var(--btn); }
.pgb.on { background: var(--btn); border-color: var(--btn); color: #fff; cursor: default; }
.pgb:disabled { opacity: 0.4; cursor: default; }
.pgb:focus-visible { outline: 3px solid rgba(0, 0, 128, 0.35); outline-offset: 2px; }
.pgd { min-width: 24px; text-align: center; color: var(--mu); }
@media (max-width: 480px) { .pgb { min-width: 36px; height: 36px; } }

/* VIP markers: identical pill (same look and colours) on the home collections, collection grid, favourites, profile and in the list view.
   SUPER VIP = red-orange, VIP = blue. #app + !important so no older rule can override it. */
#app .card .badge { padding: 4px 10px; border-radius: 8px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.3px; line-height: 1.3; text-transform: none; color: #fff !important; box-shadow: none !important; background: #F4511E !important; }
#app .card .badge.s { background: #000080 !important; }
#app .card .badge .crown { display: none; }
#app .lvip { color: #fff; }
#app .lvip.s { background: #F4511E; }
#app .lvip.v { background: #000080; }

/* ===== დამატებითი responsive ===== */

/* 700–900px: ვიწრო ტაბლეტი — მარჯვენა სვეტი (ფასი/სტიკერები) ქვემოთ ჩამოდის */
@media (max-width: 900px) and (min-width: 701px) {
  .lbody { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "side" "foot"; grid-template-rows: auto; }
  .lside { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; min-width: 0; }
  .ltop { order: 2; }
  .lside .stks { justify-content: flex-start; max-width: none; flex-basis: 100%; order: 3; }
}

/* ≤700px: სათაური 2 ხაზზე, რომ არ შეიჭრას */
@media (max-width: 700px) {
  .ltitle { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .sbar h2 { font-size: var(--fs-base); width: 100%; }
  .sctl .dd-list { width: auto; min-width: 100%; max-width: calc(100vw - 32px); }
}

/* ≤480px: სურათი პატარა, ხელსაყრელი ზომები */
@media (max-width: 480px) {
  .limg { flex-basis: 104px; border-radius: 10px; }
  .lprice .price { font-size: 18px; }
  .lcard .cact { width: 36px; height: 36px; }
  .lfoot { font-size: var(--fs-xs); }
}

/* ≤360px: სურათი თავზე, ბარათი ვერტიკალური */
@media (max-width: 360px) {
  .lcard { flex-direction: column; }
  .limg { flex-basis: auto; width: 100%; aspect-ratio: 16 / 10; }
  .sctl { gap: 8px; }
  .vtog { margin-left: auto; }
}

/* touch: დიდი შეხების არეალი, hover ეფექტების გარეშე */
@media (hover: none) and (pointer: coarse) {
  .vtog button { width: 44px; height: 44px; }
  .lcard .cact { width: 44px; height: 44px; }
  .pgb { min-width: 44px; height: 44px; }
  .lcard:hover { border-color: var(--card-bd); box-shadow: var(--card-sh); }
}

@media (prefers-reduced-motion: reduce) {
  .lcard, .limgi, .vtog button, .pgb { transition: none; }
}