/* AllCornerStore - glossy champagne gold theme (light + dark) */
* { box-sizing: border-box; }

/* ============ Light theme (default) ============ */
:root {
    --bg: #fbf6ec;
    --text: #4a3a12;
    --link: #8a6d1d;
    --header-gradient: linear-gradient(135deg, #f7e7c3 0%, #e9ce8c 45%, #d4af37 100%);
    --header-text: #4a3400;
    --header-border: #c9a227;
    --brand-text: #4a3400;
    --nav-hover: #1f1600;
    --user-chip-bg: rgba(74, 52, 0, 0.14);
    --user-chip-border: rgba(255, 255, 255, 0.6);
    --hero-gradient: linear-gradient(135deg, #f9eecb 0%, #e6c878 50%, #d9b64d 100%);
    --hero-text: #3b2d00;
    --hero-border: #d4af37;
    --btn-gradient: linear-gradient(180deg, #f9e8b8 0%, #d9b64d 100%);
    --btn-text: #4a3400;
    --btn-border: #b8912e;
    --btn-hover-gradient: linear-gradient(180deg, #f5dfa0 0%, #c9a227 100%);
    --btn-outline-text: #8a6d1d;
    --btn-outline-border: #c9a227;
    --btn-outline-hover: #f7edd4;
    --card-bg: #fffdf7;
    --card-border: #ead9a8;
    --card-shadow: 0 1px 3px rgba(184, 134, 11, 0.10);
    --stat-number: #b8860b;
    --stat-label: #7a6420;
    --input-bg: #fffef9;
    --input-border: #d9c37a;
    --alert-success-bg: #e5f4e3;
    --alert-success-border: #b7dcb0;
    --alert-success-text: #2e6b2a;
    --alert-danger-bg: #fbe3e3;
    --alert-danger-border: #f2b8b8;
    --alert-danger-text: #8a2020;
    --table-bg: #fffdf7;
    --table-border: #ead9a8;
    --table-head-bg: #f7f0dc;
    --table-head-text: #6b5410;
    --muted: #8a7a45;
    --review-border: #d4af37;
    --storefront-border: #ead9a8;
    --product-img-bg: #f2e9cf;
    --footer-bg: #3e3420;
    --footer-text: #e8d9b0;
}

/* ============ Dark theme ============ */
[data-theme="dark"] {
    --bg: #141414;
    --text: #f0e9d8;
    --link: #e3c566;
    --header-gradient: linear-gradient(135deg, #4d3f1a 0%, #3a2f12 50%, #2b230c 100%);
    --header-text: #f5e7c6;
    --header-border: #6b5410;
    --brand-text: #f5e7c6;
    --nav-hover: #ffffff;
    --user-chip-bg: rgba(255, 235, 180, 0.12);
    --user-chip-border: rgba(255, 235, 180, 0.3);
    --hero-gradient: linear-gradient(135deg, #4d3f1a 0%, #3a2f12 50%, #2b230c 100%);
    --hero-text: #f5e7c6;
    --hero-border: #6b5410;
    --btn-gradient: linear-gradient(180deg, #d9b64d 0%, #a9821f 100%);
    --btn-text: #2b230c;
    --btn-border: #c9a227;
    --btn-hover-gradient: linear-gradient(180deg, #c9a227 0%, #8a6d1d 100%);
    --btn-outline-text: #e3c566;
    --btn-outline-border: #c9a227;
    --btn-outline-hover: rgba(212, 175, 55, 0.15);
    --card-bg: #1e1c17;
    --card-border: #3d3420;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --stat-number: #e3c566;
    --stat-label: #b7a878;
    --input-bg: #26231c;
    --input-border: #6b5410;
    --alert-success-bg: #1d2e1c;
    --alert-success-border: #2e4a2b;
    --alert-success-text: #b7e0b0;
    --alert-danger-bg: #331b1b;
    --alert-danger-border: #5a2c2c;
    --alert-danger-text: #f0b3b3;
    --table-bg: #1e1c17;
    --table-border: #3d3420;
    --table-head-bg: #2a261c;
    --table-head-text: #e3c566;
    --muted: #a89a6a;
    --review-border: #c9a227;
    --storefront-border: #3d3420;
    --product-img-bg: #2a261c;
    --footer-bg: #0f0e0b;
    --footer-text: #b7a878;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    transition: background 0.3s ease, color 0.3s ease;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* Glossy champagne gold header */
.site-header {
    background: var(--header-gradient);
    color: var(--header-text);
    padding: 12px 0;
    box-shadow: inset 0 -3px 6px rgba(255, 255, 255, 0.20), 0 2px 8px rgba(0, 0, 0, 0.10);
    border-bottom: 1px solid var(--header-border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.brand {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--brand-text);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.15);
}
.brand-logo {
    height: 72px;
    width: auto;
    max-width: 260px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 8px;
    border-radius: 8px;
}
.site-header nav a { color: var(--header-text); margin-left: 12px; font-weight: 600; }
.site-header nav a:hover { color: var(--nav-hover); text-decoration: none; }
.user-chip {
    background: var(--user-chip-bg);
    padding: 4px 10px;
    border-radius: 20px;
    margin-left: 12px;
    font-size: 0.85rem;
    border: 1px solid var(--user-chip-border);
}
.mobile-menu-btn {
    display: none;
    margin-left: 12px;
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid var(--header-border);
    background: var(--user-chip-bg);
    color: var(--header-text);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}
.mobile-menu { display: inline; }
.theme-toggle {
    margin-left: 12px;
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid var(--header-border);
    background: var(--user-chip-bg);
    color: var(--header-text);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Notification bell */
.notif-wrap { position: relative; display: inline-block; margin-left: 12px; }
.notif-bell {
    position: relative;
    background: var(--user-chip-bg);
    border: 1px solid var(--user-chip-border);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.notif-badge {
    position: absolute;
    top: -5px;
    right: -6px;
    background: #d64545;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 5px;
    min-width: 18px;
}
.notif-dropdown {
    display: none;
    position: absolute;
    right: -133px;
    top: 40px;
    width: 300px;
    max-width: calc(100vw - 16px);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    z-index: 100;
    overflow: hidden;
}
.notif-dropdown.open { display: block; }
.notif-item {
    display: block;
    padding: 10px 12px;
    border-bottom: 1px solid var(--table-border);
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
}
.notif-item:hover { background: var(--table-head-bg); text-decoration: none; }
.notif-item.is-unread { background: rgba(212, 175, 55, 0.08); }
.notif-message { display: block; }
.notif-footer {
    display: block;
    text-align: center;
    padding: 8px;
    font-weight: 600;
    background: var(--table-head-bg);
}
.notification-row { border-bottom: 1px solid var(--table-border); }
.notification-row:last-child { border-bottom: none; }
.notification-link {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    color: var(--text);
    text-decoration: none;
}
.notification-row.is-unread .notification-link { font-weight: 700; }

.page { padding: 24px 16px 48px; }

/* Glossy hero */
.hero {
    background: var(--hero-gradient);
    color: var(--hero-text);
    border-radius: 14px;
    padding: 40px;
    margin: 16px 0 32px;
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 6px 18px rgba(184, 134, 11, 0.20);
    border: 1px solid var(--hero-border);
}
.hero h1 { margin: 0 0 8px; font-size: 2rem; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.15); }
.hero .btn { margin: 6px; }

/* Glossy gold buttons */
.btn {
    display: inline-block;
    background: var(--btn-gradient);
    color: var(--btn-text);
    border: 1px solid var(--btn-border);
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 4px rgba(0, 0, 0, 0.10);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.15);
}
.btn:hover {
    background: var(--btn-hover-gradient);
    text-decoration: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 3px 6px rgba(0, 0, 0, 0.12);
}
.btn-outline {
    background: transparent;
    color: var(--btn-outline-text);
    border: 1px solid var(--btn-outline-border);
    box-shadow: none;
    text-shadow: none;
}
.btn-outline:hover { background: var(--btn-outline-hover); }
.btn-danger {
    background: linear-gradient(180deg, #f8c9c9 0%, #d64545 100%);
    color: #fff;
    border: 1px solid #a83232;
    text-shadow: none;
}
.btn-danger:hover { background: linear-gradient(180deg, #f0b3b3 0%, #c03a3a 100%); }
.btn-sm { padding: 6px 10px; font-size: 0.85rem; }

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--card-shadow);
}
.card h2, .card h3 { margin-top: 0; }

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.stat { text-align: center; }
.stat-number { display: block; font-size: 2rem; font-weight: 700; color: var(--stat-number); }
.stat-label { color: var(--stat-label); font-size: 0.9rem; }

.form { max-width: 600px; }
.form label { display: block; margin: 12px 0 4px; font-weight: 600; }
.form input[type=text],
.form input[type=email],
.form input[type=password],
.form input[type=number],
.form select,
.form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--input-bg);
    color: var(--text);
}
.form .btn { margin-top: 16px; }

.radio-row label { display: inline-block; margin-right: 20px; font-weight: 400; }

.alert { border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; }
.alert p { margin: 4px 0; }
.alert-success { background: var(--alert-success-bg); border: 1px solid var(--alert-success-border); color: var(--alert-success-text); }
.alert-danger { background: var(--alert-danger-bg); border: 1px solid var(--alert-danger-border); color: var(--alert-danger-text); }

.table { width: 100%; border-collapse: collapse; background: var(--table-bg); border-radius: 10px; overflow: hidden; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--table-border); text-align: left; }
.table th { background: var(--table-head-bg); color: var(--table-head-text); }

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

.review { border-left: 4px solid var(--review-border); }

/* Storefront */
.store-card h3 { margin-bottom: 4px; }
.store-description { font-style: italic; color: var(--muted); }
.storefront-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--storefront-border);
    margin-bottom: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), 0 2px 6px rgba(184, 134, 11, 0.15);
}
.product-card { display: flex; flex-direction: column; }
.product-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 10px;
    background: var(--product-img-bg);
    margin-bottom: 10px;
    border: 1px solid var(--storefront-border);
}
.product-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}
.product-price { font-size: 1.2rem; font-weight: 700; color: var(--stat-number); margin: 8px 0; }
.add-to-cart { display: flex; align-items: center; gap: 6px; margin-top: auto; }
.add-to-cart label { margin: 0; }
.search-form { display: flex; gap: 8px; max-width: 480px; margin-bottom: 20px; }
.search-form input { flex: 1; }

.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 16px 0;
    text-align: center;
    font-size: 0.85rem;
}
.site-footer p { margin: 0; }

/* Tracking status steps */
.track-steps {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 0;
}
.track-step {
    background: var(--table-head-bg);
    border: 1px solid var(--card-border);
    padding: 6px 12px;
    border-radius: 20px;
    color: var(--muted);
    font-size: 0.85rem;
}
.track-step.done {
    background: var(--btn-gradient);
    color: var(--btn-text);
    border-color: var(--btn-border);
    font-weight: 700;
}

/* Fluid thermometer tracking bar */
.track-thermo {
    position: relative;
    height: 20px;
    background: var(--table-head-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    overflow: hidden;
}
.track-thermo-fill {
    height: 100%;
    background: linear-gradient(90deg, #d9b64d 0%, #e3a72f 60%, #d64545 100%);
    border-radius: 20px;
    transition: width 0.6s ease;
    min-width: 0;
}
.track-thermo-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--muted);
    gap: 4px;
    flex-wrap: wrap;
}
.track-thermo-labels span.active {
    color: #d9a514;
    font-weight: 700;
    text-decoration: underline;
}

/* Admin sandwich menu / sidebar */
.admin-menu-btn {
    display: inline-block;
    margin-bottom: 12px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--btn-border);
    background: var(--btn-gradient);
    color: var(--btn-text);
    font-weight: 600;
    cursor: pointer;
}
.admin-sidebar {
    position: fixed;
    left: -270px;
    top: 0;
    bottom: 0;
    width: 250px;
    background: var(--card-bg);
    border-right: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    padding: 16px;
    overflow-y: auto;
    transition: left 0.25s ease;
    z-index: 200;
}
.admin-sidebar.open { left: 0; }
.admin-sidebar h3 { margin-top: 0; }
.admin-sidebar a {
    display: block;
    padding: 9px 10px;
    color: var(--text);
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 4px;
    font-weight: 600;
}
.admin-sidebar a:hover { background: var(--table-head-bg); text-decoration: none; }
.admin-badge {
    background: #d64545;
    color: #fff;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 0.75rem;
    margin-left: 6px;
}
.oos-badge {
    display: inline-block;
    background: #d64545;
    color: #fff;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 0.75rem;
    margin-left: 4px;
}
.chat-msg {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 8px;
}
.chat-msg p { margin: 4px 0 0; }
.admin-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 150;
}
.admin-overlay.open { display: block; }

@media (max-width: 640px) {
    .header-inner { flex-direction: column; align-items: flex-start; }
    .hero { padding: 24px; }
    .table { font-size: 0.85rem; }
    .notif-dropdown {
        position: fixed;
        top: 50px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: calc(100vw - 16px);
        max-width: 340px;
    }
    /* App-like nav: only primary links stay visible */
    .site-header nav a.nav-more { display: none; }
    .mobile-menu {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        border-radius: 0 0 12px 12px;
        box-shadow: var(--card-shadow);
        z-index: 120;
        padding: 8px 12px;
    }
    .mobile-menu.open { display: block; }
    .mobile-menu a {
        display: block;
        padding: 10px 8px;
        color: var(--text);
        text-decoration: none;
        border-bottom: 1px solid var(--table-border);
    }
    .mobile-menu a:hover { background: var(--table-head-bg); text-decoration: none; }
    .mobile-menu .user-chip { display: block; margin: 8px 0; }
    .mobile-menu-btn { display: inline-block; }
    .site-header nav { position: relative; }
}
