:root {
    --accent: #c9a87c;
    --accent-dark: #a8895e;
    --dark: #1a1a2e;
    --light-bg: #faf9f7;
    --text-muted: #6c757d;
}

* { font-family: 'Prompt', sans-serif; }

body {
    background-color: var(--light-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.brand-logo { color: var(--dark); letter-spacing: 1px; }
.bg-accent { background-color: var(--accent) !important; }
.text-accent { color: var(--accent) !important; }
.btn-accent {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-accent:hover {
    background-color: var(--accent-dark);
    border-color: var(--accent-dark);
    color: #fff;
}

/* Hero */
.hero-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 50%, #3d3d5c 100%);
    color: #fff;
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(201,168,124,0.15) 0%, transparent 70%);
}
.hero-title { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; line-height: 1.2; }
.hero-subtitle { font-size: 1.1rem; opacity: 0.85; }

/* Product cards */
.product-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    background: #fff;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}
.product-card .card-img-top {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: cover;
    background: #fff;
}
.product-card .badge-sale {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #e74c3c;
    font-size: 0.75rem;
}
.product-price { font-size: 1.15rem; font-weight: 600; color: var(--dark); }
.product-compare { text-decoration: line-through; color: var(--text-muted); font-size: 0.9rem; }

/* Product detail */
.product-gallery img {
    border-radius: 12px;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #fff;
}
.option-btn {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}
.option-btn:hover { border-color: var(--accent); }
.option-btn.active {
    border-color: var(--accent);
    background: rgba(201,168,124,0.1);
    color: var(--accent-dark);
    font-weight: 500;
}

/* Cart */
.cart-item-img {
    width: 60px;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    background: #fff;
}
.qty-input { width: 70px; text-align: center; }

/* Auth */
.auth-card {
    max-width: 440px;
    margin: 0 auto;
    border: none;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}
.btn-facebook {
    background: #1877f2;
    border-color: #1877f2;
    color: #fff;
}
.btn-facebook:hover {
    background: #166fe5;
    border-color: #166fe5;
    color: #fff;
}
.btn-google {
    background: #fff;
    border: 1px solid #dadce0;
    color: #3c4043;
}
.btn-google:hover {
    background: #f8f9fa;
    border-color: #dadce0;
    color: #3c4043;
}

/* Legal pages */
.legal-content {
    max-width: 760px;
}
.legal-content h1 {
    font-size: 1.75rem;
}
.legal-content h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}
.legal-content p,
.legal-content li {
    color: #444;
    line-height: 1.75;
    font-size: 0.95rem;
}
.legal-content ul {
    padding-left: 1.25rem;
}
.legal-content a {
    color: var(--accent, #c9a87c);
}

/* Admin */
.admin-sidebar {
    min-height: calc(100vh - 56px);
    background: var(--dark);
    color: #fff;
}
.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.7);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    margin-bottom: 2px;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: #fff;
    background: rgba(201,168,124,0.2);
}
.stat-card {
    border: none;
    border-radius: 12px;
    background: #fff;
}
.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

/* Footer */
.site-footer { background: #fff; border-top: 1px solid #eee; }

/* Utilities */
.section-title {
    font-weight: 700;
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

.order-status {
    font-size: 0.8rem;
    padding: 0.35em 0.75em;
    border-radius: 20px;
    font-weight: 500;
}
.status-pending { background: #fff3cd; color: #856404; }
.status-confirmed { background: #cce5ff; color: #004085; }
.status-shipping { background: #d1ecf1; color: #0c5460; }
.status-delivered { background: #d4edda; color: #155724; }
.status-cancelled { background: #f8d7da; color: #721c24; }

.payment-status-paid { background: #d4edda; color: #155724; }
.payment-status-pending { background: #fff3cd; color: #856404; }
.payment-status-failed { background: #f8d7da; color: #721c24; }
.payment-status-expired { background: #e2e3e5; color: #383d41; }

.payment-qr-wrap {
    max-width: 280px;
    padding: 1rem;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
}
.payment-qr {
    width: 100%;
    height: auto;
}

/* jquery.Thailand.js typeahead */
.twitter-typeahead { width: 100%; }
.twitter-typeahead .tt-menu {
    width: 100%;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    z-index: 1050;
    max-height: 240px;
    overflow-y: auto;
}
.twitter-typeahead .tt-suggestion {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
}
.twitter-typeahead .tt-suggestion:hover,
.twitter-typeahead .tt-suggestion.tt-cursor {
    background: rgba(201,168,124,0.15);
}

.table-thumb {
    width: 45px;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: cover;
    border-radius: 6px;
    background: #fff;
}

.admin-img-preview {
    width: 180px;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: cover;
    background: #fff;
}

.admin-img-placeholder {
    width: 180px;
    aspect-ratio: 1 / 1;
    background: #fff;
}

.admin-image-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.admin-image-item {
    position: relative;
    width: 90px;
}

.admin-image-item .admin-img-preview {
    width: 90px;
}

.admin-image-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
    margin-top: 0.35rem;
}

.admin-image-primary {
    cursor: pointer;
    color: #ccc;
    margin: 0;
}

.admin-image-primary input {
    display: none;
}

.admin-image-primary:has(input:checked) {
    color: var(--accent);
}

.category-picker .list-group-item.active {
    background: var(--accent, #c9a87c);
    border-color: var(--accent, #c9a87c);
}

.btn-outline-accent {
    color: var(--accent, #c9a87c);
    border-color: var(--accent, #c9a87c);
}
.btn-outline-accent:hover {
    background: var(--accent, #c9a87c);
    border-color: var(--accent, #c9a87c);
    color: #fff;
}

.drag-handle {
    cursor: grab;
    display: inline-flex;
    padding: 0.25rem;
    border-radius: 0.25rem;
    user-select: none;
}

.drag-handle:active {
    cursor: grabbing;
}

.sortable-ghost {
    opacity: 0.45;
    background: #f8f9fa;
}

.sortable-ghost td {
    border-top: 2px dashed var(--accent);
    border-bottom: 2px dashed var(--accent);
}

.product-thumbs {
    margin-top: 0.5rem;
}

.product-thumb-btn {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 0;
    background: #fff;
    width: 72px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s;
}

.product-thumb-btn img {
    width: 72px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    background: #fff;
}

.product-thumb-btn:hover,
.product-thumb-btn.active {
    border-color: var(--accent);
}

/* Croppie admin modal */
#croppieContainer .cr-viewport,
#croppieContainer .cr-boundary {
    border-radius: 4px;
}
#croppieContainer .cr-viewport {
    box-shadow: 0 0 0 2000px rgba(255, 255, 255, 0.85);
}
#cropModal .modal-body {
    background: #f8f9fa;
}
#cropModal .cr-slider-wrap {
    margin-top: 12px;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}
.empty-state i { font-size: 4rem; opacity: 0.3; }

@media (max-width: 768px) {
    .hero-section { padding: 3rem 0; }
}
