/* Self-hosted Vazirmatn (variable font) — no external CDN needed. */
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/vazirmatn-arabic.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFF, U+102E0-102FB, U+10E60-10E7E, U+10EFC-10EFF, U+1EC71-1ECB4, U+1ED01-1ED3D, U+1EE00-1EEBB;
}

@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/vazirmatn-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --rose: #f43f5e;
    --rose-light: #fda4af;
    --blush: #fdf8fa;
    --gold: #d4af37;
    --gold-light: #f9e4a0;
    --cream: #fff8f0;
}

* {
    font-family: 'Vazirmatn', sans-serif;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100%;
}

body {
    background: #fdf8fa;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    margin: 0;
    padding: 0;
    padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px));
}

main {
    overflow-x: clip;
    max-width: 100%;
}

@media (min-width: 768px) {
    body {
        padding-bottom: 0;
    }
}

/* iOS notch / home-indicator safe area helper */
.pb-safe {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Mobile search bar expanded state (toggled in JS) */
#mobile-search-bar.is-open {
    max-height: 96px;
}

/* Prevent body scroll lock issues with backdrop-filter on iOS Safari */
@supports (-webkit-touch-callout: none) {
    .glass,
    .glass-card {
        -webkit-backdrop-filter: blur(14px) saturate(1.6);
    }
}

.glass {
    background: rgba(255,255,255,0.22);
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    border: 1px solid rgba(255,255,255,0.42);
    box-shadow: 0 8px 40px rgba(244,63,94,0.10), 0 2px 8px rgba(255,255,255,0.3) inset;
}

.glass-card {
    background: rgba(255,255,255,0.28);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.50);
    box-shadow: 0 4px 24px rgba(244,63,94,0.08), 0 1px 4px rgba(255,255,255,0.4) inset;
    transition: all 0.35s cubic-bezier(.4,0,.2,1);
}

.glass-card:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 12px 32px rgba(244,63,94,0.14), 0 2px 8px rgba(255,255,255,0.4) inset;
    background: rgba(255,255,255,0.35);
}

.btn-rose {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    box-shadow: 0 4px 20px rgba(244,63,94,0.40);
    transition: all 0.3s ease;
}

.btn-rose:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(244,63,94,0.55);
}

.badge-gold {
    background: linear-gradient(135deg, #d4af37, #f9e4a0, #d4af37);
    color: #7a5c00;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    will-change: transform;
}

@media (max-width: 640px) {
    .orb {
        filter: blur(50px);
        opacity: 0.18 !important;
    }
}

.nav-active {
    color: #f43f5e !important;
}

.nav-active svg {
    stroke: #f43f5e;
}

.mobile-nav-btn.active .nav-icon {
    color: #f43f5e;
}

.mobile-nav-btn.active .nav-label {
    color: #f43f5e;
    font-weight: 600;
}

.product-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-title {
    line-height: 1.15;
}

.marquee-wrap {
    overflow: hidden;
    white-space: nowrap;
}

.marquee-inner {
    display: inline-block;
    animation: marquee 22s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

html[dir="rtl"] .marquee-inner {
    animation: marquee-rtl 22s linear infinite;
}

@keyframes marquee-rtl {
    0% { transform: translateX(0); }
    100% { transform: translateX(50%); }
}

.star {
    color: #f59e0b;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    background: #f43f5e;
    border-radius: 50%;
    font-size: 10px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid white;
}

html[dir="rtl"] .cart-badge {
    right: auto;
    left: -5px;
}

.fade-in {
    animation: fadeIn 0.7s ease both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-content > * {
    animation: fadeIn 0.6s ease both;
}

.section-content > *:nth-child(1) { animation-delay: 0.05s; }
.section-content > *:nth-child(2) { animation-delay: 0.12s; }
.section-content > *:nth-child(3) { animation-delay: 0.19s; }
.section-content > *:nth-child(4) { animation-delay: 0.26s; }
.section-content > *:nth-child(5) { animation-delay: 0.33s; }
.section-content > *:nth-child(6) { animation-delay: 0.40s; }

.floating {
    animation: floating 4s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.pulse-dot {
    animation: pulseDot 1.8s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.3);
    }
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(244,63,94,0.3);
    border-radius: 10px;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #f43f5e !important;
    box-shadow: 0 0 0 3px rgba(244,63,94,0.15);
}

.category-pill {
    transition: all 0.25s ease;
    cursor: pointer;
}

.category-pill.active,
.category-pill:hover {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    color: white;
    box-shadow: 0 4px 15px rgba(244,63,94,0.35);
}

.category-slider-wrap {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}

.category-slider-track {
    display: flex;
    gap: 1rem;
    width: max-content;
    padding: 0.5rem 0 1rem;
    animation: category-slide 35s linear infinite;
    will-change: transform;
}

.category-slider-wrap:hover .category-slider-track {
    animation-play-state: paused;
}

@keyframes category-slide {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

html[dir="rtl"] .category-slider-track {
    animation: category-slide-rtl 35s linear infinite;
}

@keyframes category-slide-rtl {
    0% { transform: translateX(0); }
    100% { transform: translateX(50%); }
}

.category-card {
    min-width: 132px;
    width: 132px;
    transition: all 0.35s cubic-bezier(.4,0,.2,1);
}

.category-card:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 16px 40px rgba(244,63,94,0.16), 0 2px 8px rgba(255,255,255,0.5) inset;
    border-color: rgba(244,63,94,0.25);
}

@media (min-width: 640px) {
    .category-slider-track {
        gap: 1.25rem;
    }

    .category-card {
        min-width: 156px;
        width: 156px;
    }
}

@media (min-width: 1024px) {
    .category-slider-track {
        gap: 1.5rem;
    }

    .category-card {
        min-width: 176px;
        width: 176px;
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: clamp(2rem, 9vw, 2.6rem);
        line-height: 1.15;
    }

    .product-grid {
        gap: 12px;
    }
}

/* ----- Product card image ----- */
.product-card .product-image {
    isolation: isolate;
}

.product-card .product-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 45%, rgba(244,63,94,0.05) 100%);
    pointer-events: none;
    z-index: 1;
}

.product-card .product-image-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 0.625rem;
    transition: transform 0.45s cubic-bezier(.4,0,.2,1);
    z-index: 0;
    filter: drop-shadow(0 6px 14px rgba(0,0,0,0.07));
}

@media (min-width: 640px) {
    .product-card .product-image-img {
        padding: 0.875rem;
    }
}

.product-card:hover .product-image-img,
.product-card:focus-within .product-image-img {
    transform: scale(1.07);
}

.product-card .product-image-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(2.5rem, 11vw, 3.75rem);
    line-height: 1;
    z-index: 0;
}

.product-card .product-image .product-badge,
.product-card .product-image > button,
.product-card .product-image > div {
    z-index: 2;
}

/* ----- Mobile-friendly tweaks ----- */
@media (max-width: 480px) {
    .product-card .content {
        padding: 0.75rem;
    }

    .marquee-inner {
        animation-duration: 28s;
    }
}

/* Larger touch targets for mobile */
@media (max-width: 640px) {
    button,
    .category-pill,
    a {
        -webkit-tap-highlight-color: transparent;
    }

    .touch-btn {
        min-width: 40px;
        min-height: 40px;
    }
}

/* Avoid horizontal overflow on mobile from absolutely-positioned hero badges */
@media (max-width: 640px) {
    body {
        overflow-x: hidden;
    }
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    scrollbar-width: none;
}

input[data-jdp] {
    cursor: pointer;
}

jdp-container,
jdp-overlay {
    font-family: 'Vazirmatn', sans-serif;
}

jdp-container {
    direction: rtl;
    font-size: 12px;
    max-width: 260px;
    min-width: 260px;
    padding: 0.35rem 0 0.45rem;
    border-radius: 1rem;
    border: 1px solid rgba(244, 63, 94, 0.12);
    box-shadow: 0 10px 32px rgba(244, 63, 94, 0.14), 0 2px 8px rgba(15, 23, 42, 0.06);
}

jdp-container .jdp-months,
jdp-container .jdp-years {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

jdp-container .jdp-month select,
jdp-container .jdp-year select,
jdp-container .jdp-month input,
jdp-container .jdp-year input {
    font-size: 12px;
    font-weight: 600;
}

jdp-container .jdp-icon-minus,
jdp-container .jdp-icon-plus {
    border-color: rgba(244, 63, 94, 0.15);
    border-radius: 0.5rem;
}

jdp-container .jdp-icon-minus svg,
jdp-container .jdp-icon-plus svg {
    height: 1rem;
    width: 1rem;
    padding: 0.15rem;
}

jdp-container .jdp-days {
    padding: 0.35rem 0 0;
}

jdp-container .jdp-day,
jdp-container .jdp-day-name {
    height: 26px;
    line-height: 26px;
    font-size: 11px;
    margin: 1px 0;
}

jdp-container .jdp-day-name {
    font-size: 10px;
    font-weight: 700;
    color: #6b7280;
    background-color: rgba(244, 63, 94, 0.06);
}

jdp-container .jdp-day:not(.disabled-day):hover {
    background: rgba(244, 63, 94, 0.1);
    transform: scale(1.08);
}

jdp-container .jdp-day.selected,
jdp-container .jdp-day-name.selected {
    background-color: #f43f5e !important;
    color: #fff !important;
}

jdp-container .jdp-day.today,
jdp-container .jdp-day-name.today {
    border-color: rgba(244, 63, 94, 0.35);
    color: #e11d48;
}

jdp-container .jdp-time-container .jdp-time select {
    font-size: 12px;
    padding: 0.35rem 0.5rem 0.35rem 6px;
    border-radius: 0.5rem;
}

jdp-container .jdp-time-container .jdp-time:after {
    font-size: 1rem;
    right: -0.55rem;
}

jdp-container .jdp-footer {
    padding: 0.35rem 0.45rem 0;
}

jdp-container .jdp-btn-close,
jdp-container .jdp-btn-empty,
jdp-container .jdp-btn-today {
    font-size: 11px;
    font-weight: 600;
    padding: 0.28em 0.65em;
    border-radius: 0.5rem;
    background: #f43f5e;
}

@media only screen and (max-width: 481px) {
    jdp-container {
        font-size: 13px;
        min-width: 260px;
    }

    jdp-container .jdp-day,
    jdp-container .jdp-day-name {
        height: 30px;
        line-height: 30px;
        font-size: 12px;
    }

    jdp-container .jdp-btn-close,
    jdp-container .jdp-btn-empty,
    jdp-container .jdp-btn-today {
        font-size: 12px;
        padding: 0.4em 0.75em;
    }
}
