:root {
    --bg: #ffffff;
    --bg-2: #f3f2f8;
    --card: #ffffff;
    --card-2: #f6f5fb;
    --line: rgba(20,19,31,.12);
    --text: #16151f;
    --muted: #5d5a72;
    --violet: #7c3aed;
    --pink: #db2777;
    --blue: #2563eb;
    --grad: linear-gradient(135deg,#8b5cf6 0%,#ec4899 100%);
    --grad-2: linear-gradient(135deg,#7c3aed 0%,#2563eb 100%);
    --radius: 3px;
    --shadow: 0 24px 60px -30px rgba(20,16,45,.25);
    --primary: #7c3aed;
    --primary-soft: #f5f0ff;
    --surface: #f6f5fb;
    --success: #147a3c;
    --danger: #b13645;
    --warning: #b45309;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { height: 100%; overflow-x: hidden; }

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
}

h1, h2, h3, h4 {
    font-family: 'Inter', system-ui, sans-serif;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Header ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255,255,255,.84);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo { display: inline-flex; align-items: center; gap: 11px; }
.logo img { max-height: 46px; width: auto; }
.logo-text {
    font-family: 'Inter', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -.02em;
    background: var(--grad-2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.main-nav a {
    position: relative;
    padding: 9px 15px;
    border-radius: var(--radius);
    font-size: .95rem;
    font-weight: 500;
    color: var(--muted);
    transition: color .2s;
}
.main-nav a:hover { color: var(--text); }
.main-nav a.active { color: var(--violet); }
.main-nav a.active::after {
    content: "";
    position: absolute;
    left: 15px; right: 15px; bottom: 3px;
    height: 3px;
    border-radius: 3px;
    background: var(--grad);
    box-shadow: 0 4px 10px -4px rgba(236,72,153,.7);
}

.header-actions { display: flex; align-items: center; gap: 12px; }

.header-search {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 340px;
    margin: 0 8px 0 16px;
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .2s;
}
.header-search:focus-within { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124,58,237,.12); }
.header-search input {
    flex: 1;
    padding: 9px 14px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: .9rem;
    color: var(--text);
    min-width: 0;
}
.header-search input:focus { outline: none; }
.header-search input::placeholder { color: var(--muted); }
.header-search button {
    padding: 9px 18px;
    border: none;
    background: var(--grad);
    color: #fff;
    font-family: inherit;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s;
    white-space: nowrap;
}
.header-search button:hover { opacity: .92; }

.header-actions .cart-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border: none;
    border-radius: var(--radius);
    background: var(--grad);
    color: #fff;
    font-family: inherit;
    font-size: .92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s ease;
    box-shadow: 0 16px 34px -16px rgba(236,72,153,.55);
    position: relative;
}
.header-actions .cart-link:hover { transform: translateY(-2px); }
.cart-badge {
    background: #fff;
    color: var(--pink);
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    padding: 0 5px;
}

/* ===== Mobile menu toggle (hamburger) ===== */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card-2);
    cursor: pointer;
    align-items: center;
}
.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
    transition: transform .25s ease, opacity .2s;
}
.site-header.nav-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.nav-open .menu-toggle span:nth-child(2) { opacity: 0; }
.site-header.nav-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== General buttons ===== */
.btn {
    display: inline-block;
    padding: 11px 26px;
    border-radius: var(--radius);
    background: var(--grad);
    color: #fff;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all .25s ease;
    font-size: .95rem;
    font-family: inherit;
    box-shadow: 0 16px 34px -16px rgba(236,72,153,.55);
    text-align: center;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-block { width: 100%; text-align: center; }
.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
    box-shadow: none;
}
.btn-outline:hover { background: var(--card-2); border-color: rgba(124,58,237,.4); color: var(--violet); }
.btn-sm { padding: 8px 16px; font-size: .85rem; }

.main-content { flex: 1 0 auto; padding: 48px 0; width: 100%; }

/* ===== Hero Slider ===== */
.hero-slider {
    position: relative;
    margin-top: -45px;
    margin-bottom: 52px;
    border-radius: calc(var(--radius) + 2px);
    overflow: hidden;
}
.hero-slider-track {
    display: flex;
    transition: transform .6s ease;
}
.hero-slide {
    flex: 0 0 100%;
    width: 100%;
}
.hero-banner {
    position: relative;
    border-radius: 0;
    overflow: hidden;
    color: #fff;
    background: var(--grad-2);
    min-height: 380px;
    display: flex;
    align-items: center;
}
.hero-banner img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(124,58,237,.92), rgba(236,72,153,.85));
}
.hero-banner-image-only::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(20,19,31,.15), rgba(20,19,31,.15));
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 560px;
    padding: 48px 40px;
}
.hero-content h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 12px; }
.hero-content p { font-size: 1.05rem; opacity: .94; margin-bottom: 24px; }
.hero-content .btn { background: #fff; color: var(--text); box-shadow: none; }

.hero-slider-arrows,
.slider-arrow {
    display: none;
}

/* ===== Section headings ===== */
.section { padding-block: 24px; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 44px; }
.section-head .section-title { margin-bottom: 4px; }
.section-title {
    font-size: clamp(1.7rem, 3vw, 2.3rem);
    margin-bottom: 28px;
    font-weight: 700;
    letter-spacing: -.02em;
}
.kicker {
    display: inline-flex;
    padding: 7px 14px;
    border: 1px solid rgba(124,58,237,.2);
    border-radius: 999px;
    background: #f4edff;
    color: var(--violet);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

/* ===== Product grid ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

/* ===== View All button under category sections ===== */
.home-view { margin-bottom: 48px; }
.view-all-wrap {
    text-align: center;
    margin-top: -16px;
    margin-bottom: 48px;
}
.view-all-btn {
    display: inline-block;
    padding: 11px 34px;
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    border: none;
    font-family: inherit;
    font-size: .92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s ease;
    box-shadow: 0 6px 14px -6px rgba(0,0,0,.25);
}
.view-all-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -8px rgba(0,0,0,.3); }

.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all .28s ease;
}
.product-card:hover {
    transform: translateY(-6px);
    border-color: rgba(124,58,237,.5);
    box-shadow: var(--shadow);
}
.product-card .img-wrap {
    height: auto;
    overflow: hidden;
    background: linear-gradient(135deg,#f6f0ff,#eef2ff);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--line);
}
.product-card .img-wrap img { width: 100%; height: auto; display: block; }
.product-info { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-info .cat-label {
    font-size: .72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 600;
}
.product-info h3 { font-size: 1.08rem; font-weight: 600; }
.product-info h3 a:hover { color: var(--violet); }
.product-price { margin-top: 2px; }
.price {
    font-size: 1.15rem;
    font-weight: 700;
    background: var(--grad-2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.old-price {
    font-size: .9rem;
    color: var(--muted);
    text-decoration: line-through;
    margin-left: 8px;
}
.add-btn { margin-top: auto; width: 100%; }

/* ===== Banner strip ===== */
.banner-strip {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card-2);
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--line);
}
.banner-strip img { width: 220px; height: 140px; object-fit: cover; border-radius: var(--radius); }
.banner-strip h3 { font-size: 1.3rem; margin-bottom: 6px; }
.banner-strip p { color: var(--muted); margin-bottom: 12px; }

/* ===== Shop layout ===== */
.shop-layout { display: grid; grid-template-columns: 260px 1fr; gap: 32px; }
.sidebar { align-self: start; position: sticky; top: 90px; }
.sidebar h3 { margin-bottom: 16px; font-size: 1.1rem; }
.sidebar ul li a {
    display: block;
    padding: 10px 0;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    transition: color .2s;
}
.sidebar ul li a:hover, .sidebar ul li a.active { color: var(--violet); }
.shop-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.shop-top select {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-family: inherit;
    background: var(--card);
}

/* ===== Single product ===== */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.product-detail .img-wrap {
    background: linear-gradient(135deg,#f6f0ff,#eef2ff);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-detail .img-wrap img { width: 100%; height: auto; display: block; }
.detail-body .cat-label {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .8rem;
    font-weight: 600;
}
.detail-body h1 { font-size: clamp(1.8rem,3vw,2.4rem); margin: 8px 0 16px; }
.detail-desc { color: var(--muted); margin: 16px 0; }
.detail-body .price { font-size: 1.9rem; }
.purchase-row { display: flex; align-items: center; gap: 16px; margin-top: 24px; }
.qty-input {
    width: 72px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    text-align: center;
    background: var(--card);
}
.stock-info { margin-top: 16px; font-weight: 600; }
.stock-info.in-stock { color: var(--success); }
.stock-info.out-stock { color: var(--danger); }

/* ===== Cart ===== */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th, .cart-table td { padding: 16px; text-align: left; border-bottom: 1px solid var(--line); }
.cart-table th { background: var(--surface); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cart-item-img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius); }
.cart-summary {
    max-width: 360px;
    margin-left: auto;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
    margin-top: 32px;
    box-shadow: var(--shadow);
}
.cart-summary h3 { margin-bottom: 16px; }
.sum-row { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--muted); }
.sum-row.total {
    border-top: 1px solid var(--line);
    padding-top: 14px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text);
}
.link-danger { color: var(--danger); }

/* ===== Forms / Checkout / Auth ===== */
.form-card {
    max-width: 480px;
    margin: 0 auto;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 34px;
    box-shadow: var(--shadow);
}
.form-card h1 { margin-bottom: 24px; font-size: 1.6rem; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: .88rem; }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: .95rem;
    font-family: inherit;
    background: var(--card);
    color: var(--text);
    transition: all .2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(124,58,237,.14);
}
textarea { min-height: 110px; resize: vertical; }

.alert {
    padding: 13px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-weight: 500;
    font-size: .92rem;
}
.alert-success { background: #eafaf0; border: 1px solid #b7e6c8; color: #147a3c; }
.alert-danger { background: #fdf0f1; border: 1px solid #f5c2c7; color: #b13645; }
.alert-info { background: #eef2ff; border: 1px solid #c7d2fe; color: #3730a3; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}
.empty-state h2 { margin-bottom: 12px; color: var(--text); }
.empty-state a { color: var(--violet); font-weight: 600; }

/* ===== Footer ===== */
.site-footer {
    margin-top: 70px;
    border-top: 1px solid var(--line);
    background: rgba(247,246,251,.86);
    backdrop-filter: blur(10px);
    color: var(--text);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 44px;
    padding-block: 70px 44px;
}
.footer-col { display: flex; flex-direction: column; gap: 11px; }
.footer-col h4 { font-size: 1rem; margin-bottom: 6px; }
.footer-col p { color: var(--muted); font-size: .93rem; }
.footer-col a { width: fit-content; color: var(--muted); font-size: .93rem; transition: all .2s; }
.footer-col a:hover { color: var(--violet); transform: translateX(3px); }
.footer-logo img { max-height: 46px; width: auto; margin-bottom: 6px; }
.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-top: 1px solid var(--line);
    padding: 22px 0;
}
.footer-bottom p { color: var(--muted); font-size: .85rem; text-align: center; }

/* ===== Pagination ===== */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 24px; }
.pagination a, .pagination span {
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-weight: 500;
    color: var(--text);
}
.pagination .current { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 10px 22px -10px rgba(236,72,153,.6); }

.checkout-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.checkout-layout .cart-summary { margin-top: 0; margin-left: 0; max-width: none; width: 100%; }

@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-col:first-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    .header-inner { flex-wrap: wrap; }
    .menu-toggle { display: flex; }
    .header-actions { margin-left: auto; }
    .header-search {
        order: 5;
        flex-basis: 100%;
        max-width: 100%;
        margin: 4px 0 0;
        display: none;
    }
    .main-nav {
        order: 6;
        width: 100%;
        margin-left: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        display: none;
    }
    .site-header.nav-open .header-search { display: flex; }
    .site-header.nav-open .main-nav { display: flex; }
    .main-nav a { white-space: normal; padding: 11px 14px; }
    .main-nav a.active::after { display: none; }
}

@media (max-width: 768px) {
    .header-inner { height: auto; padding-block: 12px; gap: 12px; }
    .product-detail, .shop-layout, .checkout-layout { grid-template-columns: 1fr; }
    .product-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .product-info { padding: 12px 12px 14px; }
    .hero-banner { min-height: 0; aspect-ratio: 3 / 1; }
    .hero-content { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 20px 24px; }
    .hero-content h1 { font-size: 1.6rem; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
    .shop-layout .sidebar { position: static; }
    .cart-table thead { display: none; }
    .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; width: 100%; }
    .cart-table tr {
        border: 1px solid var(--line);
        border-radius: var(--radius);
        padding: 14px;
        margin-bottom: 14px;
        background: var(--card);
    }
    .cart-table td { border: none; padding: 8px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
    .cart-table td[data-label]::before {
        content: attr(data-label);
        font-size: .74rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .06em;
        color: var(--muted);
    }
    .cart-table td[data-label="Product"] { display: flex; }
    .cart-table td[data-label="Product"]::before { display: none; }
    .cart-summary { max-width: none; margin-left: 0; }
}
