/* Custom Web Animations, Fonts, & State Styling */

/* Custom Font Family: Brown Sugar */
@font-face {
    font-family: 'Brown Sugar';
    src: url('https://genz-official.com/fonts/brown-sugar.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #faf9f6;
}
::-webkit-scrollbar-thumb {
    background: #d0d0d0;
}
::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Announcement Bar Marquee */
.announcement-bar {
    position: relative;
    width: 100%;
    height: 40px;
    background-color: #000000;
    color: #ffffff;
    z-index: 150;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee-scroll 30s linear infinite;
}

.marquee-text {
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    white-space: nowrap;
    padding-right: 60px;
}

@keyframes marquee-scroll {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-33.33%, 0, 0); }
}

/* Apply Custom Editorial Display Font */
.logo, 
h1.font-serif, 
h2.font-serif, 
h3.font-serif, 
h4.font-serif,
.modal-title {
    font-family: 'Brown Sugar', Georgia, serif !important;
}

/* Adjust logo specifically for perfect baseline alignment and spacing */
.logo {
    font-size: 38px !important;
    letter-spacing: 1px !important;
    line-height: 1;
    padding-top: 4px;
}

/* Cart Drawer State Animations */
.cart-drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.cart-drawer.active {
    transform: translateX(0);
}

/* Checkout Modal State Animations */
.checkout-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.checkout-modal-overlay.active .checkout-modal {
    transform: scale(1);
}

/* Product Card Hover Transitions */
.product-image-wrapper img {
    transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.7s ease-in-out;
}

/* Animated Success Checkmark Tick */
.check-icon {
    box-sizing: content-box;
}

.check-icon .icon-line.line-tip {
    animation: check-tip 0.35s ease forwards;
}

.check-icon .icon-line.line-long {
    animation: check-long 0.55s ease forwards;
}

@keyframes check-tip {
    0% { width: 0; left: 1px; top: 19px; }
    54% { width: 0; left: 1px; top: 19px; }
    70% { width: 10px; left: 7px; top: 25px; }
    84% { width: 14px; left: 10px; top: 27px; }
    100% { width: 15px; left: 11px; top: 27px; }
}

@keyframes check-long {
    0% { width: 0; right: 29px; top: 32px; }
    65% { width: 0; right: 29px; top: 32px; }
    84% { width: 18px; right: 15px; top: 26px; }
    100% { width: 25px; right: 9px; top: 23px; }
}

/* Hero Carousel Content Animations */
.slide .max-w-md {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.3s;
}

.slide.opacity-100 .max-w-md {
    opacity: 1;
    transform: translateY(0);
}

/* Product Detail Modal State Animations */
.product-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.product-modal-overlay.active .product-modal {
    transform: scale(1);
}

/* ── Scroll-reveal: fade + rise as elements enter the viewport ──────────────── */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}
.reveal-on-scroll.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ── Product card hover lift ───────────────────────────────────────────────── */
/* Cards are also .reveal-on-scroll, so this transition must cover opacity too,
   otherwise it overrides the reveal fade and cards pop in instead of fading. */
.product-card {
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.product-card:hover {
    transform: translateY(-6px);
}
.product-card .product-image-wrapper {
    transition: box-shadow 0.45s ease, border-color 0.45s ease;
}
.product-card:hover .product-image-wrapper {
    box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.35);
    border-color: rgba(0, 0, 0, 0.18);
}

/* ── Primary buttons: subtle press ─────────────────────────────────────────── */
button:active,
.cart-trigger:active {
    transform: translateY(1px);
}

/* ── Nav logo gentle breathe on hover ──────────────────────────────────────── */
.navbar img {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}
.navbar img:hover {
    transform: scale(1.04);
    opacity: 0.85;
}

/* ── Login / Auth dropdown (Log In · Sign Up) ──────────────────────────────── */
/* Reveal on hover (desktop) or when JS adds .open (tap/click) — but only while
   logged out. When logged in, #loginArea gets .is-authed and this is disabled
   so the profile dropdown takes over instead. */
#loginArea:not(.is-authed):hover .auth-menu,
#loginArea.menu-open .auth-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
#loginArea:not(.is-authed):hover #loginChevron,
#loginArea.menu-open #loginChevron {
    transform: rotate(180deg);
}
/* Hide the chevron entirely once the user is logged in */
#loginArea.is-authed #loginChevron { display: none; }

/* ── Respect users who prefer reduced motion ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .reveal-on-scroll {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .product-card,
    .product-card:hover,
    .navbar img:hover {
        transform: none !important;
    }
    .marquee-track {
        animation: none !important;
    }
}
