:root {
  --ibtikar-yellow: #f8c500;
  --ibtikar-yellow-dark: #e6ad00;
  --ibtikar-black: #121212;
  --ibtikar-text: #202020;
  --ibtikar-muted: #747474;
  --ibtikar-border: #e8e8e8;
  --ibtikar-soft: #f7f7f7;
  --ibtikar-radius: 14px;
  /* Product grid is fluid: the card min-width drives the column count at every
     viewport, so there are no "dead zones" between breakpoints. Tuned so the
     shop grid lands on 4/3/2 columns as the viewport narrows — see the
     min-width:1400px cap below, which holds it at 4 on large screens. */
  --ibtikar-card-min: 215px;
  --ibtikar-grid-gap: 24px;
}

*, *::before, *::after { box-sizing: border-box; }

/* The parent theme applies a global button padding (0.688rem 1.5rem). Every
   button below sizes its own box and centres a glyph or image inside it, so
   that padding has nowhere to go but into the content — most visibly on the
   gallery thumbs, where 24px per side left the image ~14px wide. Reset it.
   .ibtikar-mobile-filter is a text button and needs its inline padding back;
   it sits inside .ibtikar-view-controls, so it needs the extra specificity. */
.ibtikar-view-controls button,
.ibtikar-filter-close,
.ibtikar-gallery-zoom,
.ibtikar-gallery-nav { padding: 0 !important; }
.ibtikar-view-controls .ibtikar-mobile-filter { padding: 0 14px !important; }

.ibtikar-shell { width: min(1460px, calc(100% - 48px)); margin-inline: auto; }

/* The hero breaks out of the theme wrapper with 100vw, which is wider than the
   document whenever a scrollbar is present. Clip the page (not `hidden`, which
   would kill sticky headers) so that overflow never becomes a horizontal scroll
   on the whole archive. */
body:has(.ibtikar-shop-hero) { overflow-x: clip; }

/* Full-bleed dark band: breaks out of the theme's centered wrapper to span the
   whole viewport, and tucks under the transparent header. */
.ibtikar-shop-hero {
  position: relative;
  overflow: hidden;
  width: 100vw;
  max-width: 100vw;
  margin-inline: calc(50% - 50vw);
  padding: clamp(72px, 9vw, 116px) 0 clamp(52px, 7vw, 96px);
  color: #fff;
  background: #202020;
  background-image:
    radial-gradient(1200px 420px at 50% -12%, rgba(248,197,0,.12), transparent 62%),
    linear-gradient(180deg, #2c2c2c 0%, #1e1e1e 100%);
}
.ibtikar-shop-hero .ibtikar-shell { position: relative; z-index: 1; }
.ibtikar-shop-hero::before,
.ibtikar-shop-hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.ibtikar-shop-hero::before { width: clamp(160px, 22vw, 300px); aspect-ratio: 1; height: auto; inset-inline-start: -10%; top: -110px; border: 2px solid rgba(248,197,0,.28); box-shadow: 0 0 0 34px rgba(248,197,0,.05); }
.ibtikar-shop-hero::after { width: clamp(180px, 25vw, 340px); aspect-ratio: 1; height: auto; inset-inline-end: -11%; bottom: -170px; border: 2px solid rgba(248,197,0,.22); box-shadow: 0 0 0 46px rgba(248,197,0,.04); }
.ibtikar-shop-hero h1 { margin: 0; text-align: center; color: #fff; font-size: clamp(28px, 5vw, 66px); line-height: 1.08; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; overflow-wrap: break-word; }
.ibtikar-breadcrumb { margin-top: clamp(14px, 2vw, 24px); display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 12px; align-items: center; color: rgba(255,255,255,.72); font-size: clamp(13px, 1.4vw, 15px); }
.ibtikar-breadcrumb a { color: rgba(255,255,255,.72); transition: color .15s ease; }
.ibtikar-breadcrumb a:hover { color: #fff; }
.ibtikar-breadcrumb span[aria-hidden] { color: var(--ibtikar-yellow); }

/* Sidebar width flexes between 992px and 1460px so the product area never gets
   starved on small laptops. */
.ibtikar-shop-wrap { display: grid; grid-template-columns: clamp(200px, 19vw, 270px) minmax(0, 1fr); gap: clamp(20px, 2.4vw, 38px); padding-block: clamp(28px, 4vw, 48px) clamp(48px, 6vw, 80px); }
.ibtikar-shop-sidebar { border-inline-end: 1px solid var(--ibtikar-border); padding-inline-end: clamp(18px, 2vw, 30px); font-size: 14px; min-width: 0; }
.ibtikar-filter-close { display: none; }
/* Drawer backdrop lives in the DOM at all sizes (the JS appends it once) but is
   only laid out once the sidebar becomes a drawer. */
.ibtikar-filter-backdrop { display: none; }
.ibtikar-filter-block { padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--ibtikar-border); }
/* Calm, consistent section labels instead of oversized headings */
.ibtikar-filter-block h2,
.ibtikar-filter-block h3 { font-size: 13px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #8a8a8a; margin: 0 0 14px; }

/* Category rows with badge counts */
.ibtikar-category-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.ibtikar-category-list a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: #4a4a4a; transition: background .15s ease, color .15s ease; }
.ibtikar-category-list a span { min-width: 0; overflow-wrap: anywhere; }
.ibtikar-category-list a:hover { background: var(--ibtikar-soft); color: var(--ibtikar-black); }
.ibtikar-category-list li.is-active a { background: var(--ibtikar-yellow); color: var(--ibtikar-black); font-weight: 600; }
.ibtikar-category-list strong { flex: none; font-weight: 600; font-size: 12px; color: #9a9a9a; background: var(--ibtikar-soft); border-radius: 999px; padding: 2px 9px; min-width: 26px; text-align: center; }
.ibtikar-category-list a:hover strong { background: #fff; color: #666; }
.ibtikar-category-list li.is-active strong { background: rgba(0,0,0,.10); color: var(--ibtikar-black); }

/* Filter accordions */
.ibtikar-filter-form details { border-bottom: 1px solid #f0f0f0; }
.ibtikar-filter-form details:last-of-type { border-bottom: 0; }
.ibtikar-filter-form summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 0; font-size: 14px; font-weight: 600; color: var(--ibtikar-black); }
.ibtikar-filter-form summary::-webkit-details-marker { display: none; }
.ibtikar-filter-form summary::after { content: ""; flex: none; width: 8px; height: 8px; margin-inline-end: 3px; border-right: 2px solid #b0b0b0; border-bottom: 2px solid #b0b0b0; transform: rotate(45deg); transition: transform .2s ease; }
.ibtikar-filter-form details[open] summary::after { transform: rotate(-135deg); }
.ibtikar-filter-form details > label:last-child { margin-bottom: 12px; }
.ibtikar-filter-form label { display: flex; align-items: center; gap: 10px; margin: 2px 0; padding: 4px 0; color: #555; cursor: pointer; transition: color .15s ease; }
.ibtikar-filter-form label:hover { color: var(--ibtikar-black); }
.ibtikar-filter-form input[type="radio"],
.ibtikar-filter-form input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--ibtikar-yellow); cursor: pointer; flex: none; }

/* Price range */
.ibtikar-price-inputs { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 10px; align-items: center; margin: 6px 0 14px; }
.ibtikar-price-inputs input { width: 100%; min-width: 0; border: 1px solid var(--ibtikar-border); border-radius: 9px; padding: 9px 11px; font-size: 16px; }
.ibtikar-price-inputs input:focus { outline: none; border-color: var(--ibtikar-yellow); box-shadow: 0 0 0 3px rgba(248,197,0,.18); }
.ibtikar-price-inputs span { color: #c4c4c4; }

/* Actions */
.ibtikar-button { width: 100%; min-height: 44px; border: 1px solid var(--ibtikar-yellow); background: var(--ibtikar-yellow); border-radius: 10px; padding: 12px 18px; font-weight: 700; font-size: 14px; cursor: pointer; transition: box-shadow .15s ease, background .15s ease, color .15s ease; }
.ibtikar-button:hover { box-shadow: 0 8px 20px rgba(248,197,0,.35); }
.ibtikar-button--outline { background: transparent; color: var(--ibtikar-yellow-dark); }
.ibtikar-button--outline:hover { background: var(--ibtikar-yellow); color: var(--ibtikar-black); box-shadow: none; }
.ibtikar-clear-filters { display: block; text-align: center; margin-top: 12px; padding: 10px; color: #9a9a9a; font-size: 13px; transition: color .15s ease; }
.ibtikar-clear-filters:hover { color: var(--ibtikar-black); }

/* Shipping card */
.ibtikar-shipping-card { margin-top: 28px; border-radius: var(--ibtikar-radius); background: linear-gradient(160deg, #fff9e8, var(--ibtikar-soft)); border: 1px solid #f3e7bd; padding: 26px 22px; text-align: center; }
.ibtikar-shipping-icon { display: block; color: var(--ibtikar-yellow-dark); font-size: 38px; margin-bottom: 8px; }
.ibtikar-shipping-card h3 { font-size: 16px; margin: 0 0 6px; }
.ibtikar-shipping-card p { margin: 0; color: #7c7c7c; font-size: 13px; line-height: 1.6; }

.ibtikar-shop-main { min-width: 0; }
.ibtikar-shop-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px 24px; margin-bottom: 24px; }
.ibtikar-view-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.ibtikar-view-controls button { min-width: 44px; min-height: 44px; border: 1px solid var(--ibtikar-border); background: #fff; border-radius: 9px; cursor: pointer; }
.ibtikar-view-controls button.is-active { background: var(--ibtikar-yellow); border-color: var(--ibtikar-yellow); }
.ibtikar-mobile-filter { display: none; padding-inline: 14px; font-weight: 600; }
.ibtikar-toolbar-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 20px; min-width: 0; }
.ibtikar-toolbar-meta .woocommerce-result-count { margin: 0; }
.ibtikar-toolbar-meta form.woocommerce-ordering { margin: 0; max-width: 100%; }
.ibtikar-toolbar-meta .orderby { max-width: 100%; min-width: 190px; min-height: 44px; border: 1px solid var(--ibtikar-border); border-radius: 9px; padding: 11px 14px; background: #fff; }

/* ---------------------------------------------------------------------------
   Product grid — fluid. auto-fill + minmax() picks the column count from the
   space actually available, so the grid reflows continuously instead of
   snapping at a handful of breakpoints. min(--ibtikar-card-min, 100%) stops a
   card from ever being wider than its container on very narrow screens.
   grid-template-columns needs !important for the same reason `display` does:
   the parent theme ships its own float/width rules for ul.products.
   --------------------------------------------------------------------------- */
.ibtikar-shop-main ul.products,
.ibtikar-related-products ul.products {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(min(var(--ibtikar-card-min), 100%), 1fr)) !important;
  gap: var(--ibtikar-grid-gap);
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
}
/* Related products span the full shell (no sidebar), so they need a wider card
   minimum to land on the same 4-column maximum. */
.ibtikar-related-products ul.products { --ibtikar-card-min: 280px; }
.ibtikar-shop-main ul.products::before,
.ibtikar-shop-main ul.products::after,
.ibtikar-related-products ul.products::before,
.ibtikar-related-products ul.products::after { display: none !important; }

.ibtikar-product-card { width: auto !important; margin: 0 !important; float: none !important; clear: none !important; min-width: 0; }
.ibtikar-product-card article { display: flex; flex-direction: column; height: 100%; border: 1px solid var(--ibtikar-border); border-radius: var(--ibtikar-radius); overflow: hidden; background: #fff; transition: transform .2s ease, box-shadow .2s ease; }
.ibtikar-product-card article:hover { transform: translateY(-4px); box-shadow: 0 14px 35px rgba(0,0,0,.08); }
.ibtikar-product-image { flex: none; display: block; position: relative; aspect-ratio: 1 / 1; background: #fafafa; overflow: hidden; }
.ibtikar-product-image img { width: 100%; height: 100%; object-fit: contain; padding: clamp(8px, 1.2vw, 14px); transition: transform .25s ease; }
.ibtikar-product-card:hover .ibtikar-product-image img { transform: scale(1.025); }
.ibtikar-stock-badge { position: absolute; inset-inline-start: 10px; bottom: 10px; background: var(--ibtikar-yellow); color: var(--ibtikar-black); border-radius: 5px; padding: 3px 7px; font-size: clamp(10px, 1vw, 11px); font-weight: 700; }
.ibtikar-product-card-body { display: flex; flex-direction: column; flex: 1; min-width: 0; padding: clamp(12px, 1.4vw, 17px); }
.ibtikar-product-category { display: block; color: #8a8a8a; font-size: clamp(11px, 1.1vw, 13px); margin-bottom: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ibtikar-product-card h2 { font-size: clamp(14px, 1.5vw, 18px) !important; line-height: 1.3; margin: 0 0 clamp(10px, 1.4vw, 18px) !important; padding: 0 !important; }
.ibtikar-product-card h2 a { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ibtikar-text); overflow-wrap: anywhere; }
/* Bottom row pinned to the card base so every card in a row lines up. */
.ibtikar-product-card-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 10px; margin-top: auto; }
.ibtikar-product-card .price { min-width: 0; color: var(--ibtikar-black) !important; font-size: clamp(15px, 1.5vw, 18px) !important; font-weight: 700 !important; margin: 0 !important; overflow-wrap: anywhere; }
.ibtikar-cart-link { flex: none; display: inline-grid !important; place-items: center; min-width: 40px; min-height: 40px; border-radius: 10px; background: transparent !important; color: var(--ibtikar-yellow-dark) !important; padding: 4px !important; margin: 0 !important; font-size: 18px !important; line-height: 1 !important; transition: background .15s ease; }
.ibtikar-cart-link:hover { background: var(--ibtikar-soft) !important; }

/* List view — higher specificity than the grid rules above so it keeps winning. */
.ibtikar-shop-main.is-list-view ul.products { grid-template-columns: minmax(0, 1fr) !important; }
.ibtikar-shop-main.is-list-view .ibtikar-product-card article { display: grid; grid-template-columns: clamp(110px, 22vw, 230px) minmax(0, 1fr); }
.ibtikar-shop-main.is-list-view .ibtikar-product-image { aspect-ratio: 1 / 1; }
.ibtikar-shop-main.is-list-view .ibtikar-product-card h2 a { -webkit-line-clamp: 3; line-clamp: 3; }

.woocommerce nav.woocommerce-pagination { margin-top: 36px; }
.woocommerce nav.woocommerce-pagination ul { border: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 0; }
.woocommerce nav.woocommerce-pagination ul li { border: 0; margin: 0; }
.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span { border: 1px solid var(--ibtikar-border); border-radius: 8px; min-width: 44px; min-height: 44px; display: grid; place-items: center; }
.woocommerce nav.woocommerce-pagination ul li span.current { background: var(--ibtikar-yellow); color: #111; }

/* ---------------------------------------------------------------------------
   Single product
   --------------------------------------------------------------------------- */
.ibtikar-single-shell { padding-block: clamp(32px, 4.5vw, 56px) clamp(48px, 6vw, 80px); }
.ibtikar-product-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(min(400px, 100%), .9fr); gap: clamp(28px, 4vw, 64px); align-items: start; }
/* Custom product gallery: main image + thumbnail strip (no slider library) */
.ibtikar-product-gallery { position: relative; min-width: 0; }
.ibtikar-product-gallery .onsale { position: absolute; top: 14px; inset-inline-end: 14px; z-index: 3; margin: 0; background: var(--ibtikar-yellow); color: #111; border-radius: 6px; padding: 5px 12px; font-weight: 700; font-size: 13px; }
.ibtikar-gallery-main { position: relative; border: 1px solid var(--ibtikar-border); border-radius: 18px; overflow: hidden; background: #fafafa; }
.ibtikar-gallery-main img.ibtikar-gallery-active { display: block; width: 100%; height: auto; max-height: min(620px, 70vh); object-fit: contain; padding: clamp(12px, 2vw, 22px); cursor: zoom-in; }
.ibtikar-gallery-zoom { position: absolute; top: 14px; inset-inline-start: 14px; z-index: 2; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--ibtikar-border); background: rgba(255,255,255,.92); color: #333; font-size: 17px; cursor: pointer; display: grid; place-items: center; transition: background .15s ease; }
.ibtikar-gallery-zoom:hover { background: #fff; }
.ibtikar-gallery-thumbs-wrap { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.ibtikar-gallery-nav { flex: none; width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--ibtikar-border); background: #fff; cursor: pointer; font-size: 18px; line-height: 1; color: #555; display: grid; place-items: center; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.ibtikar-gallery-nav:hover { background: var(--ibtikar-yellow); border-color: var(--ibtikar-yellow); color: #111; }
.ibtikar-gallery-thumbs { display: flex; gap: clamp(8px, 1.2vw, 12px); overflow-x: auto; scroll-behavior: smooth; scroll-snap-type: x proximity; flex: 1; min-width: 0; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.ibtikar-gallery-thumbs::-webkit-scrollbar { display: none; }
.ibtikar-gallery-thumb { flex: 0 0 auto; width: clamp(78px, 8vw, 90px); height: clamp(78px, 8vw, 90px); padding: 4px !important; border: 1px solid var(--ibtikar-border); border-radius: 10px; background: #fff; cursor: pointer; scroll-snap-align: start; transition: border-color .15s ease, box-shadow .15s ease; }
.ibtikar-gallery-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ibtikar-gallery-thumb.is-active { border-color: var(--ibtikar-yellow); box-shadow: inset 0 0 0 1px var(--ibtikar-yellow); }

/* Fullscreen lightbox */
.ibtikar-lightbox { position: fixed; inset: 0; z-index: 100000; background: rgba(0,0,0,.86); display: grid; place-items: center; padding: clamp(14px, 3vw, 30px); cursor: zoom-out; animation: ibtikar-fade .2s ease; }
.ibtikar-lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 8px; }
.ibtikar-lightbox-close { position: absolute; top: 10px; inset-inline-end: 14px; width: 44px; height: 44px; background: transparent; border: 0; color: #fff; font-size: 42px; line-height: 1; cursor: pointer; }
@keyframes ibtikar-fade { from { opacity: 0; } to { opacity: 1; } }
.ibtikar-product-summary { float: none !important; width: 100% !important; min-width: 0; }
.ibtikar-single-category { color: var(--ibtikar-yellow-dark); font-weight: 700; }
.ibtikar-product-summary h1 { font-size: clamp(26px, 4vw, 54px); line-height: 1.15; margin: 10px 0 12px; overflow-wrap: break-word; }
.ibtikar-single-price { font-size: clamp(22px, 3vw, 30px); font-weight: 700; color: var(--ibtikar-black); margin-bottom: 16px; }
.ibtikar-short-description { color: #666; font-size: clamp(15px, 1.6vw, 17px); line-height: 1.75; margin: 24px 0; padding-top: 24px; border-top: 1px solid var(--ibtikar-border); }
.ibtikar-product-status { margin-bottom: 22px; }
.ibtikar-product-status p { margin: 6px 0; }
.ibtikar-product-summary form.cart { display: flex; flex-wrap: wrap; gap: 14px; margin: 26px 0 !important; }
.ibtikar-product-summary .quantity .qty { min-height: 54px; max-width: 100%; border: 1px solid var(--ibtikar-border); border-radius: 10px; font-size: 16px; }
.ibtikar-product-summary .single_add_to_cart_button { flex: 1 1 200px; min-height: 54px; border-radius: 10px !important; background: var(--ibtikar-yellow) !important; color: #111 !important; font-weight: 700 !important; }
.ibtikar-product-specs { border: 1px solid var(--ibtikar-border); border-radius: 12px; overflow: hidden; }
.ibtikar-product-specs > div { display: grid; grid-template-columns: minmax(0, 160px) minmax(0, 1fr); gap: 20px; padding: 14px 16px; border-bottom: 1px solid var(--ibtikar-border); }
.ibtikar-product-specs > div:last-child { border-bottom: 0; }
.ibtikar-product-tabs { margin-top: clamp(34px, 5vw, 55px); border: 1px solid var(--ibtikar-border); border-radius: 16px; padding: clamp(16px, 2.4vw, 26px); }
.ibtikar-product-tabs .woocommerce-tabs ul.tabs { display: flex; flex-wrap: wrap; gap: 8px; padding-inline-start: 0 !important; margin-bottom: 25px !important; }
.ibtikar-product-tabs .woocommerce-tabs ul.tabs::before,
.ibtikar-product-tabs .woocommerce-tabs ul.tabs::after { display: none !important; }
.ibtikar-product-tabs .woocommerce-tabs ul.tabs li { margin: 0 !important; }
/* Wide description tables / attribute tables scroll inside the panel instead of
   pushing the page sideways. */
.ibtikar-product-tabs .woocommerce-Tabs-panel { overflow-x: auto; }
.ibtikar-product-tabs img,
.ibtikar-short-description img { max-width: 100%; height: auto; }
.ibtikar-related-products { margin-top: clamp(34px, 5vw, 55px); }
.ibtikar-related-products h2 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 24px; }
.ibtikar-benefits { margin-top: clamp(34px, 5vw, 50px); padding: clamp(18px, 2.6vw, 28px); border-radius: 14px; background: #fff9e8; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: clamp(16px, 2vw, 24px); }
.ibtikar-benefits > div { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.ibtikar-benefits span { flex: none; font-size: clamp(24px, 3vw, 30px); color: var(--ibtikar-yellow-dark); }
.ibtikar-benefits p { margin: 0; color: #666; }
.ibtikar-benefits strong { display: block; color: #111; margin-bottom: 4px; }

/* ---------------------------------------------------------------------------
   Breakpoints. The grid itself is fluid, so these only handle layout mode
   changes (sidebar becomes a drawer) and small-screen density.
   --------------------------------------------------------------------------- */
/* Above 1400px the shell is at its 1460px cap, so the available width stops
   growing — pin the grid to the 4 columns the design calls for (matching the
   loop_shop_columns filter) rather than letting auto-fill add a 5th. */
@media (min-width: 1400px) {
  .ibtikar-shop-main ul.products,
  .ibtikar-related-products ul.products { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}

@media (max-width: 991px) {
  /* Sidebar leaves the flow here, so the grid gets the full shell width — a
     wider card minimum keeps tablets at 3 across instead of jumping to 4. */
  :root { --ibtikar-card-min: 240px; }
  .ibtikar-shop-wrap { grid-template-columns: minmax(0, 1fr); }
  /* Gallery and summary side by side stop working below ~900px of content. */
  .ibtikar-product-top { grid-template-columns: minmax(0, 1fr); }
  .ibtikar-shop-sidebar {
    position: fixed; z-index: 99999; inset-block: 0; inset-inline-start: 0;
    width: min(360px, 88vw); background: #fff; padding: 24px; overflow-y: auto;
    border-inline-end: 0; transform: translateX(-105%); transition: transform .25s ease;
    box-shadow: 20px 0 60px rgba(0,0,0,.18); overscroll-behavior: contain;
  }
  [dir="rtl"] .ibtikar-shop-sidebar { transform: translateX(105%); box-shadow: -20px 0 60px rgba(0,0,0,.18); }
  .ibtikar-shop-sidebar.is-open,
  [dir="rtl"] .ibtikar-shop-sidebar.is-open { transform: translateX(0); }
  .ibtikar-filter-close { display: grid; place-items: center; margin-inline-start: auto; width: 44px; height: 44px; border: 0; background: transparent; font-size: 32px; line-height: 1; cursor: pointer; }
  .ibtikar-mobile-filter { display: inline-block; }
  /* Drawer backdrop + scroll lock (the JS toggles .ibtikar-filter-open on body). */
  .ibtikar-filter-backdrop { display: block; position: fixed; inset: 0; z-index: 99998; background: rgba(0,0,0,.45); opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease; }
  body.ibtikar-filter-open .ibtikar-filter-backdrop { opacity: 1; visibility: visible; }
  body.ibtikar-filter-open { overflow: hidden; }
}

@media (max-width: 640px) {
  :root { --ibtikar-grid-gap: 14px; }
  .ibtikar-shell { width: min(100% - 28px, 1460px); }
  /* Fixed two-up below 640px: predictable on phones and it keeps the cards
     large enough to read, instead of one full-width card per row. */
  .ibtikar-shop-main ul.products,
  .ibtikar-related-products ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .ibtikar-toolbar-meta { width: 100%; justify-content: space-between; }
  .ibtikar-toolbar-meta .woocommerce-result-count { font-size: 13px; }
  /* The select is wrapped in form.woocommerce-ordering, so the form is the flex
     item that has to grow — the select just fills it. */
  .ibtikar-toolbar-meta form.woocommerce-ordering { flex: 1 1 150px; }
  .ibtikar-toolbar-meta .orderby { width: 100%; min-width: 0; }
  /* Swiping the strip and tapping a thumb cover everything the arrows do, so
     drop them on touch widths and hand the ~88px back to the thumbnails. */
  .ibtikar-gallery-nav { display: none; }
  .ibtikar-gallery-thumbs { gap: 8px; }
  .ibtikar-gallery-thumb { width: clamp(72px, 21vw, 90px); height: clamp(72px, 21vw, 90px); }
  .ibtikar-product-specs > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .ibtikar-product-summary .quantity,
  .ibtikar-product-summary .quantity .qty { width: 100%; }
  .ibtikar-product-summary .single_add_to_cart_button { flex-basis: 100%; }
}

@media (max-width: 359px) {
  .ibtikar-shop-main ul.products,
  .ibtikar-related-products ul.products { grid-template-columns: minmax(0, 1fr) !important; }
}

@media (prefers-reduced-motion: reduce) {
  .ibtikar-product-card article,
  .ibtikar-product-image img,
  .ibtikar-shop-sidebar,
  .ibtikar-filter-backdrop { transition: none !important; }
  .ibtikar-product-card article:hover { transform: none; }
}
