/* ═══════════════════════════════════════════════════════════════════
   TABU Product Grid v12 — პროდუქტების ბადე ტაბებით
   ბარათი იგივეა, რაც არქივში და კატეგორიის ვიტრინაში. ფერი: --tabpg-brand → --tb-brand (ჰედერი) → #5b4ce6
   ═══════════════════════════════════════════════════════════════════ */
.tabpg {
    --b: var(--tabpg-brand, var(--tb-brand, #5b4ce6));
    --ink: #171a3a; --mut: #7c8099; --line: #eceef7; --soft: #eef0ff;
    --r: var(--tabpg-r, 18px); --gap: var(--tabpg-gap, 16px);
    color: var(--ink); font-family: var(--tabutech-font-family, inherit); -webkit-font-smoothing: antialiased;
}
@supports (background: color-mix(in srgb, red 10%, white)) { .tabpg { --soft: color-mix(in srgb, var(--b) 10%, #fff); } }
.tabpg *, .tabpg *::before, .tabpg *::after { box-sizing: border-box; }
.tabpg a { text-decoration: none; color: inherit; }
.tabpg button { font-family: inherit; cursor: pointer; -webkit-appearance: none; appearance: none; margin: 0; text-shadow: none; box-shadow: none; letter-spacing: normal; text-transform: none; }
.tabpg .tabpg-i { display: block; flex-shrink: 0; }
.tabpg [hidden] { display: none !important; }
.tabpg-empty { padding: 20px; background: #fff8e5; border: 1px dashed #dba617; border-radius: 12px; font-size: 14px; }
.tabpg .added_to_cart, .tabpg a.wc-forward { display: none !important; }

/* ── სათაური + ტაბები ── */
.tabpg .tabpg-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 20px; margin-bottom: 16px; }
.tabpg .tabpg-title { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.2px; line-height: 1.15; color: var(--ink); text-transform: none; }
.tabpg.tabpg--tbar .tabpg-title { border-left: 4px solid var(--b); padding-left: 12px; border-radius: 2px; }
.tabpg .tabpg-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-right: auto; }
.tabpg .tabpg-tab { height: 38px; padding: 0 16px; border-radius: 12px; border: 1px solid #dfe2ee; background: #fff; color: #22254a; font-size: 13.5px; font-weight: 500; line-height: 1; white-space: nowrap; transition: border-color .15s, color .15s, background-color .15s; }
.tabpg .tabpg-tab:hover { border-color: var(--b); color: var(--b); }
.tabpg .tabpg-tab.is-on, .tabpg .tabpg-tab.is-on:hover { background: var(--soft); border-color: var(--b); color: var(--b); font-weight: 600; }
.tabpg .tabpg-tab:focus-visible { outline: 3px solid color-mix(in srgb, var(--b) 40%, transparent); outline-offset: 2px; }
.tabpg .tabpg-title + .tabpg-tabs { margin-left: 4px; }
.tabpg .tabpg-all { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--b); white-space: nowrap; }
.tabpg .tabpg-tabs ~ .tabpg-all { margin-left: 0; }
.tabpg .tabpg-all:hover { text-decoration: underline; }
.tabpg .tabpg-allb, .tabpg .tabpg-tile { display: none; }

/* ── ბადე ── */
.tabpg .tabpg-grid { display: grid; grid-template-columns: repeat(var(--tabpg-cols, 5), minmax(0, 1fr)); gap: var(--gap); }
.tabpg .tabpg-none { grid-column: 1 / -1; margin: 0; padding: 30px 10px; text-align: center; color: var(--mut); font-size: 14px; }
@media (min-width: 1025px) { .tabpg .tabpg-card.tabpg-h-d:not(.tabpg-on) { display: none; } }

/* ── ბარათი ── */
.tabpg .tabpg-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, border-color .2s; }
.tabpg .tabpg-card:hover { border-color: #d5d8e6; box-shadow: 0 10px 28px rgba(23,26,58,.09); }
.tabpg .tabpg-im { display: flex; align-items: center; justify-content: center; height: 190px; padding: 14px; background: #fff; overflow: hidden; }
.tabpg .tabpg-img { display: block; width: 100% !important; height: 100% !important; max-width: 100% !important; max-height: 100% !important; object-fit: contain !important; object-position: center !important; }
.tabpg .tabpg-card.is-out .tabpg-im { opacity: .5; }
.tabpg .tabpg-bd { position: absolute; left: 12px; top: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; pointer-events: none; }
.tabpg .tabpg-b { height: 24px; padding: 0 9px; border-radius: 8px; font-size: 12px; font-weight: 700; display: flex; align-items: center; color: #fff; }
.tabpg .tabpg-b--sale { background: #d92d20; } .tabpg .tabpg-b--new { background: var(--soft); color: var(--b); } .tabpg .tabpg-b--out { background: #e9ebf5; color: #5b6080; }
.tabpg .tabpg-cb { padding: 0 16px 16px; display: flex; flex-direction: column; flex: 1; }
.tabpg .tabpg-br { font-size: 11px; letter-spacing: .07em; font-weight: 700; color: #8a90b8; text-transform: uppercase; }
.tabpg .tabpg-nm { font-size: 14px; line-height: 1.38; font-weight: 500; margin-top: 4px; height: 39px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tabpg .tabpg-nm:hover { color: var(--b); }
.tabpg .tabpg-stock { font-size: 12px; margin-top: 8px; display: flex; align-items: center; gap: 6px; color: #16794a; }
.tabpg .tabpg-stock::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #16a34a; }
.tabpg .tabpg-stock.is-no { color: #8a90b8; } .tabpg .tabpg-stock.is-no::before { background: #b5b9cf; }
.tabpg .tabpg-pr { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; }
.tabpg .tabpg-pv { display: flex; flex-direction: column; min-width: 0; }
.tabpg .tabpg-pv b { font-size: 18px; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.tabpg .tabpg-pv b small { font-size: 12px; font-weight: 500; color: var(--mut); }
.tabpg .tabpg-pv b.is-sale { color: #d92d20; }
.tabpg .tabpg-pv s { font-size: 12px; color: #8a90b8; margin-bottom: 2px; white-space: nowrap; }
.tabpg .tabpg-add { width: 44px; height: 44px; padding: 0; min-width: 0; min-height: 0; border-radius: 14px; border: 0; background: var(--b); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; line-height: 1; font-size: 14px; transition: transform .12s, filter .15s; }
.tabpg .tabpg-add:hover, .tabpg .tabpg-add:focus, .tabpg .tabpg-add:active { background: var(--b) !important; color: #fff !important; }
.tabpg .tabpg-add:hover { filter: brightness(1.08); } .tabpg .tabpg-add:active { transform: scale(.94); }
.tabpg .tabpg-add.is-off, .tabpg .tabpg-add.is-off:hover, .tabpg .tabpg-add.is-off:focus { background: #eceef7 !important; color: #a3a8c6 !important; cursor: default; }
.tabpg .tabpg-add.is-ok, .tabpg .tabpg-add.is-ok:hover, .tabpg .tabpg-add.is-ok:focus { background: #e3f6ec !important; color: #0f7a4a !important; width: auto; padding: 0 14px; gap: 6px; font-size: 13px; font-weight: 600; }
.tabpg .tabpg-add--choose, .tabpg .tabpg-add--choose:hover, .tabpg .tabpg-add--choose:focus { width: auto; padding: 0 16px; background: #fff !important; color: var(--b) !important; border: 1.5px solid var(--b); font-size: 13.5px; font-weight: 600; }
.tabpg .tabpg-add.is-load svg { animation: tabpg-sp 1s linear infinite; }
@keyframes tabpg-sp { to { transform: rotate(360deg); } }
.tabpg .tabpg-add:focus-visible, .tabpg .tabpg-nm:focus-visible { outline: 3px solid color-mix(in srgb, var(--b) 40%, transparent); outline-offset: 2px; }

/* ჩატვირთვის ჩონჩხი */
.tabpg .tabpg-sk .tabpg-im { background: linear-gradient(90deg, #eef0f8 0%, #f7f8fc 50%, #eef0f8 100%); background-size: 200% 100%; animation: tabpg-sh 1.4s ease-in-out infinite; margin: 14px; border-radius: 10px; height: 150px; }
.tabpg .tabpg-sk .tabpg-cb i { display: block; height: 12px; border-radius: 6px; margin-top: 10px; background: linear-gradient(90deg, #eef0f8, #f7f8fc, #eef0f8); background-size: 200% 100%; animation: tabpg-sh 1.4s ease-in-out infinite; }
.tabpg .tabpg-sk .tabpg-cb i:nth-child(1) { width: 40%; } .tabpg .tabpg-sk .tabpg-cb i:nth-child(2) { width: 90%; } .tabpg .tabpg-sk .tabpg-cb i:nth-child(3) { width: 60%; margin-bottom: 8px; }
@keyframes tabpg-sh { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── მეტის ჩატვირთვა ── */
.tabpg .tabpg-more-wrap { display: flex; justify-content: center; margin: 26px 0 4px; }
.tabpg .tabpg-loadmore { height: 48px; border-radius: 14px; background: #fff; border: 1.5px solid var(--b); color: var(--b); font-size: 14px; font-weight: 700; padding: 0 28px; display: inline-flex; align-items: center; gap: 8px; line-height: 1; }
.tabpg .tabpg-loadmore:hover, .tabpg .tabpg-loadmore:focus { background: var(--soft) !important; color: var(--b) !important; }
.tabpg .tabpg-loadmore.is-load { opacity: .6; pointer-events: none; }

/* ── ტაბლეტი ── */
@media (max-width: 1024px) and (min-width: 769px) {
    .tabpg .tabpg-grid { grid-template-columns: repeat(var(--tabpg-cols-t, 3), minmax(0, 1fr)); }
    .tabpg .tabpg-card.tabpg-h-t:not(.tabpg-on) { display: none; }
}

/* ── მობილური ── */
@media (max-width: 768px) {
    /* ეკრანის ორივე კიდემდე — კონტეინერის ტიპის (column/row), padding-ისა და სიგანის მიუხედავად: JS ზუსტ მარცხენა კიდეს ზომავს, fallback — 100vw */
    body:not(.elementor-editor-active) .tabpg { width: var(--tw-w, 100vw); max-width: none; margin-left: var(--tw-ml, calc(50% - 50vw)); }
    .elementor-editor-active .tabpg { width: 100%; margin-left: 0; }
    .tabpg .tabpg-card.tabpg-h-m:not(.tabpg-on) { display: none; }
    .tabpg .tabpg-head { padding: 0 16px; margin-bottom: 10px; gap: 8px 12px; }
    .tabpg .tabpg-title { font-size: 19px; }
    .tabpg.tabpg--tbar .tabpg-title { border-left-width: 3px; padding-left: 10px; }
    .tabpg .tabpg-title { flex: 1 1 0; min-width: 0; }                 /* გრძელი სათაური ეკრანზე გადადის, „ყველას ნახვა" იმავე რიგში რჩება */
    .tabpg .tabpg-all { font-size: 13px; margin-left: auto; order: 2; flex: 0 0 auto; }
    .tabpg .tabpg-tabs { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 4px; scrollbar-width: none; }
    .tabpg .tabpg-tabs::-webkit-scrollbar { display: none; }
    .tabpg .tabpg-tab { height: 36px; padding: 0 14px; font-size: 13px; flex: 0 0 auto; }
    .tabpg .tabpg-title + .tabpg-tabs { margin-left: -16px; }

    .tabpg--m-scroll .tabpg-grid { display: flex; gap: 10px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 2px 16px 6px; scroll-padding-left: 16px; }
    .tabpg--m-scroll .tabpg-grid::-webkit-scrollbar { display: none; }
    .tabpg--m-scroll .tabpg-card { flex: 0 0 152px; scroll-snap-align: start; }
    .tabpg--m-scroll .tabpg-tile { display: flex; flex: 0 0 120px; scroll-snap-align: start; border-radius: 16px; background: var(--soft); color: var(--b); flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 700; text-align: center; padding: 10px; }
    .tabpg--m-scroll .tabpg-tile i { width: 40px; height: 40px; border-radius: 50%; background: var(--b); color: #fff; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 22px; line-height: 1; }
    .tabpg--m-scroll .tabpg-more-wrap { display: none; }

    .tabpg--m-grid .tabpg-grid { grid-template-columns: repeat(var(--tabpg-cols-m, 2), minmax(0, 1fr)); gap: 10px; padding: 0 16px; }
    .tabpg--m-grid .tabpg-allb { display: flex; align-items: center; justify-content: center; margin: 12px 16px 0; height: 46px; border-radius: 14px; border: 1.5px solid var(--b); color: var(--b); font-weight: 700; font-size: 14px; }
    .tabpg--m-grid.tabpg--has-more .tabpg-allb { display: none; }

    .tabpg .tabpg-card { border-radius: 16px; }
    .tabpg .tabpg-im { height: 120px; padding: 10px; }
    .tabpg .tabpg-bd { left: 8px; top: 8px; } .tabpg .tabpg-b { height: 22px; font-size: 11.5px; padding: 0 8px; }
    .tabpg .tabpg-cb { padding: 0 12px 12px; }
    .tabpg .tabpg-nm { font-size: 13px; height: 36px; margin-top: 2px; }
    .tabpg .tabpg-stock { display: none; }
    .tabpg .tabpg-pv b { font-size: clamp(12px, 3.5vw, 14px); font-weight: 700; }
    .tabpg .tabpg-pv s { font-size: 10.5px; }
    .tabpg .tabpg-pv .woocommerce-Price-currencySymbol { font-size: .88em; }
    .tabpg .tabpg-pr { gap: 6px; }
    .tabpg .tabpg-add { width: 36px; height: 36px; border-radius: 12px; }
    .tabpg .tabpg-add--choose { height: 36px; padding: 0 12px; font-size: 12.5px; }
    .tabpg .tabpg-sk .tabpg-im { height: 100px; }
    .tabpg .tabpg-more-wrap { margin: 18px 0 0; }
}

/* ── სიგანე: 2K/4K ეკრანზეც შიგთავსი ჰედერის „მაქს. სიგანეზე" (--tb-maxw, 2000px) მეტად არ ფართოვდება ── */
@media (min-width: 769px) {
    .tabpg.tabpg--limit {
        width: 100%;
        max-width: calc(var(--tb-maxw, 2000px) + 2 * var(--tb-pad, 40px));
        margin-left: auto; margin-right: auto;
        padding-left: var(--tw-pl, var(--tb-pad, 40px));
        padding-right: var(--tw-pr, var(--tb-pad, 40px));
    }
}
@media (prefers-reduced-motion: reduce) { .tabpg *, .tabpg *::before { transition-duration: .01ms !important; animation-duration: .01ms !important; } }


/* ═════════════════════════════════════════════════════════════════════════
   ერთიანი ზომები — სამივე პლაგინში (ვიტრინა, ბადე ტაბებით, არქივი) იდენტურია.
   ტელეფონი: სათაური 16px · სახელი 12px · ბრენდი 10px · ფასი 13px · ძველი ფასი 10px · ღილაკი 34px
   ═════════════════════════════════════════════════════════════════════════ */
@media (min-width: 769px) {
    .tabpg .tabpg-title { font-size: 24px; }
}
@media (max-width: 768px) {
    .tabpg .tabpg-title { font-size: 16px; line-height: 1.2; font-weight: 700; letter-spacing: 0; }
    .tabpg.tabpg--tbar .tabpg-title { border-left-width: 3px; padding-left: 9px; }
    .tabpg .tabpg-head { gap: 6px 10px; margin-bottom: 10px; }
    .tabpg .tabpg-all { font-size: 12.5px; }
    .tabpg .tabpg-im { height: 112px; padding: 8px; }
    .tabpg .tabpg-cb { padding: 0 10px 10px; }
    .tabpg .tabpg-br { font-size: 10px; letter-spacing: .06em; }
    .tabpg .tabpg-nm { font-size: 12px; line-height: 1.3; height: 31px; margin-top: 2px; }
    .tabpg .tabpg-pv b { font-size: 13px; font-weight: 700; }
    .tabpg .tabpg-pv s { font-size: 10px; }
    .tabpg .tabpg-pv .woocommerce-Price-currencySymbol { font-size: .9em; }
    .tabpg .tabpg-add { width: 34px; height: 34px; border-radius: 11px; }
    .tabpg .tabpg-add--choose { height: 34px; padding: 0 11px; font-size: 12px; }
    .tabpg .tabpg-b { height: 20px; font-size: 10.5px; padding: 0 7px; border-radius: 7px; }
    .tabpg .tabpg-bd { left: 7px; top: 7px; gap: 4px; }
}
@media (max-width: 768px) {
    .tabpg .tabpg-tab { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }
}
