/* RaboTeb storefront — product-detail and catalogue additions: favourites (heart), the photo lightbox, the INCI list,
   brand links and filters, active-filter chips and the cart's deals. Uses the tokens of store.css / theme.css. */

/* ── Heart (علاقه‌مندی) ── */
.fav-form { margin: 0; display: inline-flex; }
.fav-btn {
    display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; padding: 0;
    border: 1px solid var(--border, #e1e6e2); border-radius: 50%; background: var(--surface, #fff);
    color: var(--muted, #67736d); font-size: 1.25rem; cursor: pointer; transition: color .15s, transform .15s, border-color .15s, background-color .15s;
}
.fav-btn:hover { color: #e5484d; border-color: #f3b4b5; }
.fav-btn:active { transform: scale(.9); }
.fav-btn.is-on { color: #e5484d; border-color: #f7c8c9; background: #fff5f5; }
.fav-btn.is-on i { animation: fav-pop .35s cubic-bezier(.2, .8, .2, 1); }
.fav-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@keyframes fav-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
.product-card { position: relative; }
.tile-fav { position: absolute; top: .9rem; inset-inline-end: .9rem; z-index: 2; }
.tile-fav .fav-btn { width: 34px; height: 34px; font-size: 1.05rem; background: rgba(255, 255, 255, .92); box-shadow: 0 2px 8px rgba(11, 16, 14, .12); border-color: transparent; }

/* ── Product page: title row, brand, continue ── */
.pd-title-row { display: flex; align-items: flex-start; gap: .75rem; }
.pd-title-row .pd-title { flex: 1; }
.pd-fav .fav-btn { width: 44px; height: 44px; font-size: 1.35rem; }
.pd-brand { display: inline-flex; align-items: center; gap: .3rem; color: var(--text); text-decoration: none; border: 1px solid var(--border); border-radius: 999px; padding: .15rem .7rem; background: var(--surface); transition: border-color .15s, color .15s; }
.pd-brand:hover { border-color: var(--primary); color: var(--primary); }
.pd-brand .ti-award { color: var(--primary); }
.pd-continue { display: flex; width: fit-content; align-items: center; gap: .4rem; margin: 1.5rem auto .5rem; padding: .6rem 1.4rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; text-decoration: none; }
.pd-continue:hover { border-color: var(--primary); color: var(--primary); }

/* ── Product page: photos ── */
.pd-zoom { position: relative; display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; cursor: zoom-in; }
.pd-zoom img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pd-zoom-hint, .pd-counter {
    position: absolute; bottom: .75rem; display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .65rem;
    border-radius: 999px; background: rgba(11, 16, 14, .62); color: #fff; font-size: .78rem; pointer-events: none;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.pd-zoom-hint { inset-inline-start: .75rem; opacity: 0; transition: opacity .2s; }
.pd-zoom:hover .pd-zoom-hint, .pd-zoom:focus-visible .pd-zoom-hint { opacity: 1; }
.pd-counter { inset-inline-end: .75rem; font-variant-numeric: tabular-nums; }
@media (hover: none) { .pd-zoom-hint { opacity: 1; } }

.pd-lightbox { width: min(980px, calc(100% - 1.5rem)); max-height: calc(100dvh - 1.5rem); padding: 0; border: 0; border-radius: 20px; background: #fff; color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.pd-lightbox::backdrop { background: rgba(6, 12, 9, .78); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.pd-lightbox[open] { display: flex; flex-direction: column; animation: lb-in .22s ease-out; }
@keyframes lb-in { from { opacity: 0; transform: scale(.97); } }
.pd-lb-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; border-bottom: 1px solid var(--border); font-weight: 700; }
.pd-lb-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-lb-close, .pd-lb-nav button, .pd-inci header button {
    display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 50%;
    background: var(--surface); color: var(--text); font-size: 1.2rem; cursor: pointer; flex: none;
}
.pd-lb-close:hover, .pd-lb-nav button:hover, .pd-inci header button:hover { border-color: var(--primary); color: var(--primary); }
.pd-lb-photo { flex: 1; min-height: 0; display: grid; place-items: center; padding: 1rem; background: #fff; touch-action: pan-y; }
.pd-lb-photo img { max-width: 100%; max-height: min(72dvh, 760px); object-fit: contain; user-select: none; }
.pd-lb-nav { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: .6rem 1rem .9rem; font-variant-numeric: tabular-nums; color: var(--muted); }

/* ── Product page: INCI list ── */
.pd-inci-open {
    display: flex; width: 100%; align-items: center; gap: .65rem; margin-top: .85rem; min-height: 50px; padding: .65rem 1rem;
    border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; text-align: start;
    transition: border-color .15s, background-color .15s;
}
.pd-inci-open:hover, .pd-inci-open:focus-visible { border-color: var(--primary); background: var(--tint); }
.pd-inci-open > .ti:first-child { color: var(--primary); font-size: 1.3rem; }
.pd-inci-open b, .pd-inci h2 b { font-size: .75rem; letter-spacing: .05em; color: var(--muted); }
.pd-inci-open small { color: var(--muted); margin-inline-start: auto; }
.pd-inci { width: min(30rem, calc(100% - 2rem)); max-height: min(78dvh, 40rem); padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: 18px; color: var(--text); background: #fff; box-shadow: 0 16px 60px rgba(11, 16, 14, .3); }
.pd-inci::backdrop { background: rgba(11, 16, 14, .55); }
.pd-inci header { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .5rem; }
.pd-inci h2 { margin: 0; font-size: 1.1rem; }
.pd-inci ol { margin: 0; padding-inline-start: 2.2rem; text-align: left; }
.pd-inci li { padding: .42rem .25rem; border-top: 1px solid #edf1ee; overflow-wrap: anywhere; font-size: .9rem; }
.pd-inci li::marker { color: var(--primary); font-variant-numeric: tabular-nums; }
.pd-inci-note { margin: .75rem 0 0; font-size: .78rem; color: var(--muted); }

/* ── Catalogue: brands and active filters ── */
.st-brand-chips { display: flex; gap: .45rem; overflow-x: auto; padding: .15rem 0 .75rem; scrollbar-width: none; }
.st-brand-chips::-webkit-scrollbar { display: none; }
.st-brand-chips a {
    flex: none; display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .8rem; border: 1px solid var(--border);
    border-radius: 999px; background: var(--surface); color: var(--text); font-size: .85rem; text-decoration: none; transition: border-color .15s, color .15s;
}
.st-brand-chips a:hover { border-color: var(--primary); color: var(--primary); }
.st-brand-chips .ti { color: var(--primary); }
.st-brand-chips small { color: var(--muted); font-variant-numeric: tabular-nums; }
.st-active { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin: 0 0 .9rem; }
.st-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .75rem; border-radius: 999px; background: var(--tint); color: var(--primary); font-size: .85rem; font-weight: 600; text-decoration: none; border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); }
.st-chip:hover { background: color-mix(in srgb, var(--primary) 16%, #fff); }
.st-chip-clear { font-size: .82rem; color: var(--muted); }

/* ── Favourites page ── */
.fav-empty { text-align: center; padding: 2.5rem 1rem; }
.fav-empty > .ti { font-size: 3rem; color: #e5484d; }
.fav-empty h2 { font-size: 1.15rem; margin: .5rem 0; }
.fav-empty p { color: var(--muted); max-width: 32rem; margin: 0 auto 1rem; }

/* ── Cart: today's deals ── */
.cart-deals { margin-top: 1.25rem; }
.cart-deals h2 { display: flex; align-items: center; gap: .4rem; font-size: 1.05rem; margin: 0 0 .75rem; }
.cart-deals h2 .ti { color: var(--rb-hot, #e63b1f); }
.cart-deals .st-rail > .product-card { flex: 0 0 200px; }

@media (prefers-reduced-motion: reduce) {
    .fav-btn.is-on i, .pd-lightbox[open] { animation: none; }
}

/* ── Models of one product (انتخاب مدل یا نوع) ── */
.pd-variants { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
.pd-variants legend { float: none; width: auto; margin-bottom: .6rem; font-size: .95rem; font-weight: 700; color: var(--text); }
.pd-variants legend small { font-weight: 400; color: var(--muted); margin-inline-start: .35rem; }
.pd-variants > div { display: flex; flex-wrap: wrap; gap: .5rem; }
.pd-variant {
    display: inline-flex; align-items: center; gap: .45rem; min-height: 46px; padding: .35rem .75rem .35rem .45rem; max-width: 100%;
    border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); text-decoration: none;
    transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.pd-variant img { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; background: var(--tint); flex: none; }
.pd-variant-check { width: 18px; height: 18px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid #a9b8ae; font-size: .7rem; }
.pd-variant-name { font-weight: 600; font-size: .88rem; overflow-wrap: anywhere; }
.pd-variant small { color: var(--muted); font-size: .76rem; white-space: nowrap; }
.pd-variant:hover { border-color: var(--primary); }
.pd-variant.is-on { border-color: var(--primary); background: var(--tint); box-shadow: 0 0 0 1px var(--primary) inset; }
.pd-variant.is-on .pd-variant-check { background: var(--primary); border-color: var(--primary); color: #fff; }
.pd-variant.is-out { opacity: .6; }
.pd-variant.is-out .pd-variant-name { text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, .35); }
.pd-variant:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tile-models { display: flex; align-items: center; gap: .2rem; color: var(--muted); font-size: .74rem; font-weight: 500; }

/* ── Brand logo, website and the brand's listing ── */
.pd-brand.has-logo { padding: .2rem .5rem; }
.pd-brand img { height: 30px; max-width: 110px; object-fit: contain; display: block; }
.pd-brand-site { display: inline-flex; align-items: center; gap: .25rem; font-size: .84rem; color: var(--primary); }
.st-brand-intro { display: flex; align-items: center; gap: 1.1rem; margin: -.25rem 0 1rem; padding: .9rem 1.1rem; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.st-brand-intro img { height: 56px; max-width: 140px; object-fit: contain; flex: none; }
.st-brand-intro p { margin: 0 0 .3rem; color: var(--text); line-height: 1.8; font-size: .92rem; }
.st-brand-intro a { display: inline-flex; align-items: center; gap: .25rem; font-size: .86rem; color: var(--primary); }
@media (max-width: 575.98px) { .st-brand-intro { flex-direction: column; align-items: flex-start; } }

/* ── Expiry date ── */
.pd-expiry { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: .5rem 0; padding: .55rem .8rem; border-radius: 12px; background: var(--tint); color: var(--text); font-size: .88rem; }
.pd-expiry .ti { color: var(--primary); font-size: 1.1rem; }
.pd-expiry time { font-weight: 700; }
.pd-expiry small { color: var(--muted); }
