﻿:root {
    --bg: #f5f1e8;
    --surface: #fffdf9;
    --primary: #19543d;
    --primary-strong: #123e2d;
    --accent: #d9a441;
    --text: #1f1d1a;
    --muted: #6f675d;
    --danger: #9b2c2c;
    --radius: 18px;
    --shadow: 0 14px 30px rgba(20, 27, 24, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 10% 5%, rgba(217, 164, 65, 0.25), transparent 28%),
        radial-gradient(circle at 90% 12%, rgba(25, 84, 61, 0.25), transparent 32%),
        var(--bg);
    min-height: 100vh;
}

.hero {
    padding: 40px 28px 20px;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    gap: 20px;
    position: relative;
    overflow: hidden;
    min-height: 420px;
    border-radius: 22px;
    margin: 16px 18px 0;
}

.hero::before {
    content: '';
    position: absolute;
    inset: -5%;
    background: url('/static/shop/img/logos.png') center/cover no-repeat;
    opacity: 0.22;
    filter: saturate(0.95);
    z-index: 0;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(245, 241, 232, 0.25) 0%, rgba(245, 241, 232, 0.86) 84%, rgba(245, 241, 232, 1) 100%),
        linear-gradient(90deg, rgba(245, 241, 232, 0.92) 0%, rgba(245, 241, 232, 0.35) 40%, rgba(245, 241, 232, 0.12) 70%, rgba(245, 241, 232, 0.3) 100%);
    z-index: 1;
}

.hero-copy {
    flex: 1;
    position: relative;
    z-index: 3;
    max-width: 760px;
    padding-top: 24px;
}

.tag {
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0 0 10px;
}

h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3rem);
}

.subtitle {
    margin-top: 12px;
    max-width: 740px;
    color: var(--muted);
}

.header-actions {
    position: absolute;
    right: 24px;
    top: 24px;
    z-index: 4;
    display: flex;
    gap: 8px;
    align-items: center;
}

.mobile-actions {
    display: none;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.cart-button,
.secondary-button,
.add-btn {
    border: none;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    height: 40px;
    padding: 0 16px;
}

.cart-button,
.add-btn {
    background: var(--primary);
    color: #fff;
}

.secondary-button {
    border: 1px solid #d3cec5;
    background: #f6f2eb;
    color: #2e2b27;
}

.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.cart-count-badge {
    background: var(--accent);
    color: #1d1b16;
    border-radius: 999px;
    padding: 2px 8px;
    margin-left: 6px;
}

.products-grid {
    padding: 10px 28px 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.product-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.product-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.product-card .content {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-card h2 {
    margin: 5px 0;
    font-size: 1.2rem;
}

.product-card p {
    color: var(--muted);
    min-height: 40px;
}

.product-card strong {
    display: block;
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.add-form {
    margin-top: auto;
}

.qty-control {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    gap: 6px;
    margin-bottom: 10px;
}

.variant-select {
    width: 100%;
    border: 1px solid #d7d1c8;
    border-radius: 10px;
    padding: 9px 10px;
    margin-bottom: 8px;
    background: #fff;
    font: inherit;
}

.qty-btn,
.qty-input {
    border-radius: 12px;
    border: 1px solid #d7d1c8;
    height: 40px;
}

.qty-btn {
    background: #f2eee7;
    font-size: 1.1rem;
    cursor: pointer;
}

.qty-input {
    width: 100%;
    text-align: center;
    font-weight: 700;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 80;
}

.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(360px, 95vw);
    background: #ffffff;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    z-index: 90;
}

.sidebar.open {
    transform: translateX(0);
}

.overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.sidebar-head,
.sidebar-foot {
    padding: 16px;
    border-bottom: 1px solid #ece8e0;
}

.sidebar-foot {
    border-top: 1px solid #ece8e0;
    border-bottom: none;
    margin-top: auto;
}

.sidebar-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-head button {
    border: none;
    background: transparent;
    font-weight: 700;
    cursor: pointer;
}

.sidebar-items {
    padding: 12px 16px;
    overflow: auto;
}

.cart-item {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #ece8e0;
}

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 10px;
}

.cart-item h4 {
    margin: 0;
    font-size: 0.95rem;
}

.cart-meta {
    color: var(--muted);
    font-size: 0.9rem;
}

.cart-actions {
    margin-top: 8px;
    display: flex;
    gap: 6px;
}

.cart-actions button {
    border: 1px solid #dbd5cb;
    background: #f8f6f1;
    border-radius: 8px;
    cursor: pointer;
    padding: 4px 8px;
}

.cart-actions .remove,
.danger-btn {
    border-color: #efc5c5;
    color: var(--danger);
}

.checkout-form {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.checkout-form input,
.checkout-form select,
.checkout-form textarea {
    width: 100%;
    border: 1px solid #d7d1c8;
    border-radius: 10px;
    padding: 10px;
    font: inherit;
    background: #fff;
}

.checkbox-line {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.92rem;
    color: var(--muted);
}

.payment-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(16, 22, 19, 0.45);
    z-index: 120;
}

.payment-modal,
.panel-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(92vw, 440px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
    padding: 18px;
    z-index: 130;
}

.panel-modal {
    width: min(96vw, 980px);
}

.payment-modal h3,
.panel-modal h3 {
    margin: 0 0 8px;
    text-align: center;
}

.payment-modal p {
    margin: 0 0 12px;
    color: var(--primary-strong);
    text-align: center;
}

.payment-modal img {
    width: min(250px, 100%);
    display: block;
    margin: 0 auto 14px;
    border: 1px solid #ece8e0;
    border-radius: 10px;
}

.payment-close-btn {
    border: none;
    background: transparent;
    font-weight: 700;
    cursor: pointer;
    position: absolute;
    right: 12px;
    top: 10px;
}

.panel-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr 1fr;
}

.panel-subtitle {
    margin: 0 0 8px;
    font-weight: 700;
}

.panel-subtitle-muted {
    margin-top: 12px;
    color: var(--muted);
}

.panel-list {
    border: 1px solid #ebe6de;
    border-radius: 12px;
    padding: 8px;
    max-height: 420px;
    overflow: auto;
    background: #fcfaf6;
}

.panel-row {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 10px;
    padding: 8px;
    border-bottom: 1px solid #ece8df;
    border-left: 4px solid transparent;
}

.panel-row-active {
    border-left-color: #2f8a5c;
}

.panel-row-inactive {
    border-left-color: #9b2c2c;
    opacity: 0.82;
}

.panel-row:last-child {
    border-bottom: none;
}

.panel-row img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
}

.panel-row-actions {
    margin-top: 6px;
    display: flex;
    gap: 6px;
    align-items: center;
}

.panel-row-actions button {
    border: 1px solid #d8d2c8;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    padding: 4px 8px;
}

.panel-row-actions form {
    margin: 0;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    margin-left: 6px;
    font-weight: 700;
}

.status-chip-active {
    background: #e3f4e9;
    color: #216642;
}

.status-chip-inactive {
    background: #f9e3e3;
    color: #8b2323;
}

.panel-list-inactive {
    background: #fcf6f6;
}

.manage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 18px;
}

.manage-header h1 {
    margin: 0;
    font-size: clamp(1.3rem, 3vw, 2rem);
}

.manage-page {
    padding: 0 18px 24px;
}

.flash-list {
    margin-bottom: 12px;
}

.flash-item {
    background: #eaf4ec;
    border: 1px solid #cadecd;
    color: #1f4e38;
    border-radius: 10px;
    padding: 10px;
    margin: 0 0 8px;
}

@media (max-width: 900px) {
    .panel-grid {
        grid-template-columns: 1fr;
    }

    .header-actions {
        flex-wrap: wrap;
        max-width: 280px;
        justify-content: flex-end;
    }
}

@media (max-width: 640px) {
    .hero {
        flex-direction: column;
        padding: 28px 18px 14px;
        min-height: 0;
        overflow: hidden;
        margin: 10px 12px 0;
    }

    .header-actions {
        display: none;
    }

    .mobile-actions {
        display: flex;
    }

    .mobile-actions .secondary-button,
    .mobile-actions .cart-button {
        width: 100%;
    }

    .products-grid {
        padding: 10px 18px 30px;
    }

    .manage-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px;
    }

    .manage-page {
        padding: 0 12px 18px;
    }
}
