/* ============================================================
   GREY — OpenCart bridge layer. Loaded AFTER grey.css.
   Adapts the prototype (which used .ph placeholders + fake data)
   to real OpenCart markup: real product images, logo sizing,
   helper utilities. Keep grey.css pristine; put OC-specific
   overrides here.
   ============================================================ */

/* real product/category images fill the prototype's media boxes */
.pcard-media .pcard-img,
.cat-cell .c-thumb img,
.cart-line .thumb img,
.search-thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.pcard-media { background: var(--media); }
.cat-cell .c-thumb,
.cart-line .thumb,
.search-thumb { position: relative; overflow: hidden; }

/* logo as an <img> of the static SVG wordmark — header sizing lives in grey.css (.brand-logo) */
.foot-logo { height: 46px; width: auto; display: block; }

/* CRITICAL: the cart drawer scrim is ALWAYS in the DOM (unlike the React
   prototype, which conditionally mounted it). grey.css only sets opacity:0 when
   closed, so without this it stays a full-screen fixed layer (z-index 90) that
   swallows EVERY click site-wide — the page looks fine but is non-interactive.
   opacity alone does NOT stop click capture; pointer-events must be toggled. */
.drawer-scrim { pointer-events: none; }
.drawer-scrim.open { pointer-events: auto; }

/* pagination — OC common/pagination outputs Bootstrap .pagination markup */
.grey-pagination { margin-top: 40px; display: flex; justify-content: center; }
.grey-pagination .pagination { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.grey-pagination .page-link { display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); font-family: var(--fm); font-size: 13px; color: var(--ink-soft); background: var(--card); transition: border-color .2s, background .2s, color .2s; }
.grey-pagination .page-link:hover { border-color: var(--ink); color: var(--ink); }
.grey-pagination .page-item.active .page-link { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* facet checkbox rows render as <a> (grey.css .fopt is fine: flex + .box) */
.filters .fopt { text-decoration: none; }
/* sub-category refine links — plain, no checkbox box */
.filters .refine-link { display: block; padding: 7px 0; font-size: 14.5px; color: var(--ink-soft); transition: color .2s; }
.filters .refine-link:hover { color: var(--ink); }

/* full-width catalog (no refine sidebar) */
.catalog-layout.no-sidebar { grid-template-columns: 1fr; }

/* PDP gallery real images */
.gallery-main img,
.gthumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.gthumb { background: none; padding: 0; }
/* accordion: grey.css caps .acc-body at 260px — allow longer product descriptions */
.acc-item.open .acc-body { max-height: 1600px; }

/* auth as a standalone page (grey.css .auth-card is built for the modal:
   hidden until .auth-ov.open — reset it for the page version) */
.auth-page { min-height: 70vh; display: grid; place-items: center; padding: 48px var(--pad); }
.auth-page .auth-card { opacity: 1; transform: none; box-shadow: 0 24px 60px -30px rgba(19,17,9,.32); }
.auth-page .auth-x { display: none; }
.cinput[aria-invalid="true"] { border-color: #b6402c; }
/* error spans only show once grey.js fills them (the .auth-err bg would otherwise show as an empty pink bar) */
.auth-err:empty { display: none; }
.auth-switch a { font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* account dashboard link rows */
.profile-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 2px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 500; color: var(--ink-soft); transition: color .2s, padding-left .2s; }
.profile-row:last-child { border-bottom: 0; }
.profile-row:hover { color: var(--ink); padding-left: 6px; }
.profile-row svg { width: 16px; height: 16px; color: var(--muted-2); transition: color .2s, transform .25s var(--ease); }
.profile-row:hover svg { color: var(--ink); transform: translate(2px,-2px); }
.pstat { text-decoration: none; }

/* cart page (download-as-XLS model — no checkout) */
.cartpage-grid { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: clamp(24px,3vw,48px); align-items: start; }
.cart-summary { position: sticky; top: calc(var(--nav-h) + 18px); background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: clamp(20px,2.4vw,28px); }
.cartpage-line { grid-template-columns: 72px 1fr auto; }
.cartpage-line .thumb { width: 72px; height: 72px; }
@media (max-width: 860px) { .cartpage-grid { grid-template-columns: 1fr; } .cart-summary { position: static; } }

/* CMS / article content (information pages, blog articles) */
.grey-article { color: var(--ink-soft); font-size: 16px; line-height: 1.7; }
.grey-article p { margin: 0 0 16px; }
.grey-article h2 { font-size: clamp(22px,2.6vw,30px); margin: 34px 0 14px; color: var(--ink); }
.grey-article h3 { font-size: 20px; margin: 28px 0 12px; color: var(--ink); }
.grey-article ul, .grey-article ol { margin: 0 0 16px; padding-left: 22px; }
.grey-article li { margin-bottom: 7px; }
.grey-article a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.grey-article img { border-radius: 14px; margin: 12px 0; max-width: 100%; height: auto; }
.grey-article iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 14px; margin: 16px 0; display: block; }
.grey-article video { max-width: 100%; height: auto; border-radius: 14px; margin: 16px 0; display: block; }
.grey-article figure { margin: 16px 0; }
.grey-article figcaption { font-size: 13.5px; color: var(--muted); margin-top: 8px; }
.grey-article table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.grey-article td, .grey-article th { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }

/* order history rows */
.order-list { border-top: 1px solid var(--line); }
.order-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto 24px; align-items: center; gap: 18px; padding: 20px 4px; border-bottom: 1px solid var(--line); transition: padding-left .2s; }
.order-row:hover { padding-left: 8px; }
.order-row .o-id { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.order-row .o-date { font-family: var(--fm); font-size: 12px; color: var(--muted); margin-top: 3px; }
.order-row .o-status { font-family: var(--fm); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-soft); display: inline-block; }
.order-row .o-go { color: var(--muted-2); transition: color .2s, transform .25s var(--ease); }
.order-row:hover .o-go { color: var(--ink); transform: translate(2px,-2px); }
@media (max-width: 680px) { .order-row { grid-template-columns: 1fr auto; } .order-row .o-status, .order-row .o-count { display: none; } }

/* blog cards */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px,2vw,30px); }
@media (max-width: 900px) { .blog-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px) { .blog-grid { grid-template-columns: 1fr; } }
.blog-card { display: flex; flex-direction: column; }
.blog-card .bc-media { aspect-ratio: 16/10; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--card); position: relative; }
.blog-card .bc-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.blog-card:hover .bc-media img { transform: scale(1.04); }
.blog-card .bc-date { font-family: var(--fm); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
.blog-card .bc-title { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.blog-card .bc-excerpt { color: var(--muted); font-size: 14px; margin-top: 8px; }
.article-head { display: flex; flex-direction: column; gap: 12px; margin: 18px 0 28px; }
.article-meta { font-family: var(--fm); font-size: 12px; color: var(--muted); display: flex; gap: 16px; }
.article-hero { aspect-ratio: 21/9; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 30px; position: relative; }
.article-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* native <select> styled like .cinput (address form, custom fields) */
select.cinput { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238c887d' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; cursor: pointer; }

/* address cards */
.addr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 16px; }
.addr-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; }
.addr-card .addr-body { font-size: 14.5px; color: var(--ink-soft); line-height: 1.6; flex: 1; }
.addr-card .addr-actions { display: flex; gap: 10px; margin-top: 18px; }

/* qty stepper in cart lines: shrink to content (the flex-column parent
   stretches it full-width by default) */
.cart-line .qty { align-self: flex-start; }

/* utilities */
[hidden] { display: none !important; }
.grey-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* marquee built from a server list: duplicate track is rendered in markup */
.marquee-track { min-width: max-content; }

/* language pills rendered as <a> (grey.css styled only <button>) */
.nav-lang a { font-family: var(--fm); font-size: 11px; font-weight: 500; letter-spacing: .04em; padding: 5px 9px; border-radius: 999px; color: var(--muted); transition: color .2s, background .2s; }
.nav-lang a.on { background: var(--ink); color: var(--paper); }
.nav-lang a:not(.on):hover { color: var(--ink); }
.mmenu-lang a { font-family: var(--fm); font-size: 12px; font-weight: 500; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--muted); }
.mmenu-lang a.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
/* topbar lang pills — light on the dark bar */
.topbar .tb-lang { display: inline-flex; gap: 4px; align-items: center; }
.topbar .tb-lang a { color: var(--on-invert-mut); padding: 2px 6px; border-radius: 999px; letter-spacing: .04em; transition: color .2s; }
.topbar .tb-lang a.on,
.topbar .tb-lang a:hover { color: var(--on-invert); }
