﻿/* ===========================
   Design tokens
=========================== */
:root {
    --brand: #c8a128; /* teal (CTA, new price, progress)   */
    --brand-ink: #000;
    --ink: #1b1b1b; /* main text */
    --muted: #6f6f6f; /* secondary text */
    --line: #eaded3; /* borders in cart */
    --paper: #ffffff; /* cart drawer background */
    --page: #fdfdfd; /* page background */
    --card: #ffffff; /* product cards */
    --shadow: 0 8px 20px rgba(0,0,0,.08);
    --shadow-lg: 0 20px 40px rgba(0,0,0,.16);
    --radius: 14px;
    --radius-sm: 10px;
    --speed: 220ms;
}
/* =========================================================
   THEME (light/dark via data-theme on <html>)
========================================================= */
:root {
    color-scheme: light;
}

html[data-theme="dark"] {
    --brand: #d2b34c;
    --brand-ink: #000;
    --ink: #e9e9e9;
    --muted: #a8a8a8;
    --line: #2e2e2e;
    --paper: #111;
    --page: #0c0c0c;
    --card: #151515;
    --shadow: 0 8px 20px rgba(0,0,0,.5);
    --shadow-lg: 0 20px 40px rgba(0,0,0,.6);
}

    html[data-theme="dark"] body {
        background: var(--page);
        color: var(--ink);
    }

    html[data-theme="dark"] header.topnav {
        background: #000;
    }
    html[data-theme="dark"] h3 {
        color: #fff;
    }
    html[data-theme="dark"] strong {
        color: #fff;
    }

/* =========================================================
   TOP NAV
========================================================= */
.topnav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #000;
    color: #fff;
    padding: .6rem 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,.25);
}

    .topnav .nav-inner {
        max-width: 1200px;
        margin: 0 auto;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .topnav .brand {
        display: flex;
        align-items: center;
        gap: .6rem;
    }

    .topnav .title {
        font-size: 1.25rem;
        margin: 0;
    }

.logo-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand);
    display: inline-block;
    box-shadow: 0 0 0 3px rgba(200,161,40,.2);
}

.icon-btn {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,.15);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform .12s ease, background .25s ease;
}

    .icon-btn:hover {
        background: rgba(255,255,255,.08);
    }

    .icon-btn:active {
        transform: scale(.96);
    }

.nav-actions {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.cart-btn {
    position: relative;
}

.badge-dot {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--brand);
    color: #000;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    font-size: .72rem;
    display: grid;
    place-items: center;
    font-weight: 800;
    padding: 0 4px;
}

/* =========================================================
   FILTERS TOOLBAR (Sort dropdown + Gender chips)
========================================================= */
.filters-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0 1.5rem;
}

.dropdown {
    position: relative;
}

.dropdown-toggle {
    background: #fff;
    color: #111;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: .55rem .8rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
}

html[data-theme="dark"] .dropdown-toggle {
    background: #121212;
    color: #eaeaea;
    border-color: #2a2a2a;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 220px;
    background: #fff;
    color: #111;
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 5;
}

html[data-theme="dark"] .dropdown-menu {
    background: #121212;
    color: #eaeaea;
    border-color: #2a2a2a;
}

.dropdown.open .dropdown-menu {
    display: flex;
}

.dropdown-menu button {
    text-align: left;
    padding: .7rem .9rem;
    border: 0;
    background: transparent;
    cursor: pointer;
}

    .dropdown-menu button:hover {
        background: #f6f6f6;
    }

html[data-theme="dark"] .dropdown-menu button:hover {
    background: #1a1a1a;
}

.gender-filter {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.chip {
    border: 1px solid #ddd;
    border-radius: 999px;
    padding: .4rem .9rem;
    background: #fff;
    color: #111;
    cursor: pointer;
}

    .chip.active, .chip:hover {
        background: var(--brand);
        color: #000;
        border-color: var(--brand);
    }

html[data-theme="dark"] .chip {
    background: #121212;
    color: #eaeaea;
    border-color: #2a2a2a;
}

/* =========================================================
   SEARCH MODAL
========================================================= */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 1100;
}

    .modal.show {
        display: block;
    }

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(2px);
    display: none;
    z-index: 1095;
}

    .modal-backdrop.show {
        display: block;
    }

.modal__dialog {
    position: absolute;
    top: 8vh;
    left: 50%;
    transform: translateX(-50%);
    width: min(900px, 94vw);
    background: var(--paper);
    color: var(--ink);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    border: 0;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    color: var(--ink);
}

.modal__header {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

    .modal__header input {
        flex: 1;
        height: 44px;
        border: 1px solid #e1e1e1;
        border-radius: 12px;
        padding: 0 .9rem;
        outline: none;
        background: #fff;
        color: #111;
    }

html[data-theme="dark"] .modal__header input {
    background: #0f0f0f;
    color: #e9e9e9;
    border-color: #2a2a2a;
}

.modal__list {
    max-height: 60vh;
    overflow: auto;
}

.search-row {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
}

    .search-row img {
        width: 64px;
        height: 64px;
        object-fit: cover;
        border-radius: 10px;
        border: 1px solid #eee;
        background: #fff;
    }

    .search-row .meta small {
        color: var(--muted);
        display: block;
    }

    .search-row .price {
        font-weight: 800;
        color: var(--brand);
    }

    .search-row .mini-chip {
        border: 1px solid #ddd;
        padding: .15rem .5rem;
        border-radius: 999px;
        font-size: .75rem;
        margin-left: .4rem;
    }

    .search-row .row-actions button {
        background: var(--brand);
        color: #000;
        border: 0;
        border-radius: 999px;
        height: 36px;
        padding: 0 .9rem;
        cursor: pointer;
    }


.product-search {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 2rem auto; /* center it horizontally */
}

    .product-search input {
        width: 100%;
        padding: 0.8rem 1rem 0.8rem 2.8rem; /* room for icon */
        font-size: 1rem;
        border: 1px solid #ccc;
        border-radius: var(--radius);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
        outline: none;
        background: #fff;
        transition: border-color 0.3s, box-shadow 0.3s;
        display: block;
        margin: 0 auto;
    }

        .product-search input:focus {
            border-color: var(--brand);
            box-shadow: 0 0 0 3px rgba(200, 161, 40, 0.2);
        }

    .product-search i {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: #aaa;
        font-size: 1rem;
        pointer-events: none;
        z-index: 2;
        transition: color 0.3s;
    }




/* ===========================
   Global / Base
=========================== */
* {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

html, body {
    height: 100%;
}

body {
     margin: 0;
    background: var(--page);
    color: var(--ink);
}

h2 {
    text-align: center;
    font-size: 2rem;
    margin: 2rem 0;
}

img {
    max-width: 100%;
    display: block;
}

/* ===========================
   Header (reveals on scroll)
=========================== */
header {
    background: #000;
    color: #fff;
    padding: 1rem 2rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,.3);
}

    header h1 {
        margin: 0;
        font-size: 2rem;
    }

#main-header {
    position: fixed;
    top: 0;
    width: 100%;
    background: #000;
    color: #fff;
    padding: 1rem 2rem;
    text-align: center;
    transform: translateY(-100%);
    transition: transform var(--speed) ease-in-out;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,.2);
}

    #main-header.visible {
        transform: translateY(0);
    }

/* ===========================
   Hero
=========================== */
.hero {
    background: url('uploads/homepage/cover.jpg') center/cover no-repeat;
    height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

    .hero::before {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,.4);
        z-index: 1;
    }

.hero-text {
    position: relative;
    z-index: 2;
    font-size: 5rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    text-shadow: 3px 3px 10px rgba(0,0,0,.7);
    opacity: 0;
    transform: translateY(30px);
    animation: slideInFade 1.2s ease-out forwards .1s;
}

@keyframes slideInFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   Layout container
=========================== */
.container {
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: auto;
}


/* ===========================
   Product Grid + Card
=========================== */
.products {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(240px,1fr));
    gap: 1.5rem;
}

.product {
    position: relative;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--speed) ease, box-shadow var(--speed) ease;
    animation: fadeInUp .6s ease both;
}

    .product:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
    }

    .product .thumb {
        width: 100%;
        height: 240px;
        object-fit: cover;
        background: #f6f6f6;
    }

/* Discount badge */
.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #24c58b;
    color: #fff;
    font-weight: 700;
    font-size: .78rem;
    border-radius: 8px;
    padding: 6px 10px;
    z-index: 2;
}

/* Card content */
.card-body {
    padding: 14px 14px 58px;
}

.product h3 {
    margin: 6px 0;
    font-size: 1rem;
    font-weight: 700;
    color: #111;
}

/* Rating row */
.rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 6px 0 8px;
    color: var(--brand);
    font-size: .9rem;
}

    .rating svg {
        width: 16px;
        height: 16px;
        display: block;
    }

        .rating svg path {
            fill: currentColor;
        }

    .rating .count {
        color: #6d6d6d;
        font-size: .85rem;
    }

/* Prices */
.price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.price-from, .price-main {
    color: var(--brand);
    font-weight: 700;
}

.price-old {
    color: #9b9b9b;
    text-decoration: line-through;
    font-size: .9rem;
}

/* Round Add-to-Cart button */
.add-btn {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
     transition: transform .15s ease, filter .15s ease;
}

    .add-btn:hover {
        transform: scale(1.05);
        filter: brightness(.98);
    }

    .add-btn:active {
        transform: scale(.96);
    }

    .add-btn svg {
        width: 22px;
        height: 22px;
        fill: #fff;
    }
.btn-added {
    background: #24c58b !important;
    color: #fff !important;
    transform: scale(1.05);
    animation: addedPulse 0.4s ease;
}

@keyframes addedPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}


/* ===========================
   Buttons (generic)
=========================== */
.btn {
    background: #000;
    color: #fff;
    padding: .6rem 1.2rem;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    margin: 1rem 0;
    transition: transform .12s ease, background .25s ease;
}

    .btn:hover {
        background: #c8a128;
        color: #000;
    }

    .btn:active {
        transform: translateY(1px) scale(.98);
    }

/* ===========================
   Footer (3 columns)
=========================== */
footer {
    background: #000;
    color: #ddd;
    padding: 3rem 2rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit,minmax(250px,1fr));
    align-items: start;
}

.footer-logo {
    width: 80px;
    margin-bottom: 2px;
}

.about {
    font-size: .95rem;
    line-height: 1.6;
    color: #ccc;
}

footer h3 {
    color: #c8a128;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

footer .info p, footer .about {
    margin: .4rem 0;
    font-size: .95rem;
    color: #ccc;
}

footer a {
    color: #c8a128;
    text-decoration: none;
    transition: color .3s;
}

    footer a:hover {
        color: #fff;
    }

footer .copyright {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 2rem;
    font-size: .85rem;
    color: #888;
}

/* ===========================
   Floating Cart trigger
=========================== */
#cart-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #000;
    color: #fff;
    padding: 10px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 2px 6px #c8a128a6;
    z-index: 1001;
    transition: background .3s, transform .25s;
    animation: bob 3s ease-in-out infinite;
}

    #cart-toggle:hover {
        background: #c8a128;
        color: #000;
        transform: translateY(-2px);
    }

@keyframes bob {
    0%,100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

/* ===========================
   Cart drawer (full height)
=========================== */
#cart-widget {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 420px;
    background: var(--paper);
    border-left: 1px solid var(--line);
    border-radius: 0;
    box-shadow: -12px 0 32px #c8a1281d;
    display: none;
    z-index: 1001;
    padding: 0;
    overflow: hidden;
    transform: translateX(24px);
    opacity: 0;
}

    #cart-widget.open {
        display: flex;
        flex-direction: column;
        animation: drawerIn var(--speed) ease-out forwards;
    }

    #cart-widget[style*="block"] { /* support style toggling from JS */
        display: flex;
        flex-direction: column;
        animation: drawerIn var(--speed) ease-out forwards;
    }

@keyframes drawerIn {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Header */
#cart-widget > h3 {
    margin: 0;
    padding: 18px 20px 12px;
    font-size: 1.2rem;
    font-weight: 800;
    color: #111;
    border-bottom: 1px solid var(--line);
    position: relative;
}

/* Promo + progress */
.promo-msg {
    padding: 10px 20px 8px;
    font-size: .95rem;
    font-weight: 600;
    color: #1a1a1a;
}

    .promo-msg strong {
        font-weight: 800;
    }

.progress-container {
    margin: 0 20px 10px;
    height: 6px;
    background: #e8ded3;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--brand);
    animation: progressPulse 1.6s ease-in-out infinite;
    transition: width .35s ease;
}

@keyframes progressPulse {
    0%,100% {
        filter: saturate(1);
    }

    50% {
        filter: saturate(1.15);
    }
}

/* Scrollable items area */
.cart-items {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0 16px;
    font-size: .95rem;
    border-top: 1px solid #f1e6db;
    border-bottom: 1px solid #f1e6db;
}

/* Cart row (aligned like screenshot) */
.cart-item {
    display: grid;
    grid-template-columns: 64px 1fr auto; /* image | info | controls */
    gap: 14px;
    padding: 14px 4px;
    border-bottom: 1px solid #efe5db;
}

.cart-thumb {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: #fff;
    border: 1px solid #eee1d6;
}

.cart-product-info {
    display: block;
}

    .cart-product-info strong {
        font-size: .98rem;
        color: #111;
        display: block;
        line-height: 1.2;
    }

    .cart-product-info small {
        font-size: .83rem;
        color: var(--muted);
        display: block;
        margin: 2px 0 6px;
    }

.price-new {
    font-weight: 800;
    color: var(--brand);
    font-size: .95rem;
}

.price-old {
    text-decoration: line-through;
    font-size: .9rem;
    color: #9b9b9b;
    margin-left: 8px;
}

/* Qty + actions (RIGHT column, fixed width) */
.cart-controls {
    justify-self: end; /* sticks to the right edge */
    display: inline-grid;
    grid-auto-flow: column;
    align-items: center;
    column-gap: 10px;
    min-width: 160px; /* keeps column width consistent for every row */
}

.qty-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #dfd3c7;
    background: rgba(0,0,0,.08);
    line-height: 1;
    font-size: 18px;
    cursor: pointer;
    transition: transform .12s ease, background .2s ease, box-shadow .2s ease;
}

    .qty-btn:hover {
        background: #efdfd1;
        box-shadow: 0 2px 6px rgba(0,0,0,.08);
    }

    .qty-btn:active {
        transform: scale(.94);
    }

.cart-controls .qty-num {
    min-width: 18px;
    text-align: center;
    font-weight: 700;
}

.del-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #dfd3c7;
    background: rgba(0,0,0,.08);
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    font-size: 16px;
    transition: transform .12s ease, background .2s, box-shadow .2s ease;
}

    .del-btn:hover {
        background: #efdfd1;
        box-shadow: 0 2px 6px rgba(0,0,0,.08);
    }

    .del-btn:active {
        transform: scale(.94);
    }

/* Slight scale on any button within list */
#cart-items button:hover {
    transform: translateY(-1px);
}

/* Footer area: total + CTA */
#cart-widget > p {
    margin: 10px 20px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
}

#cart-widget > div:last-child {
    padding: 0 20px 18px;
}

.checkout-btn, #cart-widget .btn:first-child {
    width: 100%;
    height: 54px;
    border-radius: 999px;
    border: 0;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    letter-spacing: .3px;
     transition: transform .12s ease, filter .2s ease;
}

    #cart-widget .btn:first-child:hover {
        filter: brightness(.98);
    }

    #cart-widget .btn:first-child:active {
        transform: translateY(1px) scale(.99);
    }

/* ===========================
   Animations / helpers
=========================== */
@keyframes shake {
    0% {
        transform: translate(0,0);
    }

    25% {
        transform: translate(2px,0);
    }

    50% {
        transform: translate(-2px,0);
    }

    75% {
        transform: translate(2px,0);
    }

    100% {
        transform: translate(0,0);
    }
}

.shake {
    animation: shake .4s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   Small screens polish
=========================== */
@media (max-width:480px) {
    #cart-widget {
        width: 100%;
    }

    .cart-thumb {
        width: 56px;
        height: 56px;
    }

    .cart-controls {
        min-width: 140px;
        column-gap: 8px;
    }
}
