:root {
    --primary-dark: #0f172a;
    --primary-light: #1e293b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --accent: #0891b2;
    --success: #10b981;
    --error: #ef4444;
    --spacing: 1rem;
    --transition: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-white);
    line-height: 1.6;
}

/* Navigation */
.navbar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.navbar-brand h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.navbar-menu {
    display: flex;
    gap: 2.5rem;
    flex: 1;
    justify-content: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color var(--transition);
}

.nav-link:hover {
    color: var(--accent);
}

.navbar-icons {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.icon-link {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    border: none;
    background: none;
    transition: color var(--transition);
    position: relative;
}

.icon-link:hover {
    color: var(--accent);
}

.cart-icon {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--error);
    color: white;
    font-size: 0.75rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.cart-count.hidden {
    display: none;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
}

.page-section {
    display: none;
}

.page-section.active {
    display: block;
}

/* Hero Section */
.hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hero-title {
    font-family: inherit;
    font-size: 3rem;
    font-weight: 300;
    line-height: 1;
    letter-spacing: 0;
    color: #111827;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 3.75rem;
    }
}

@media (min-width: 1024px) {
    .hero-title {
        font-size: 4.5rem;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 9999px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    width: fit-content;
}

.btn-primary {
    background: var(--primary-dark);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.2);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--primary-dark);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════
   Hero Gallery — 4-image staggered 2×2 grid

   Desktop layout:
   ┌─────────────────┬─────────────────┐
   │  img-1 (tall)   │  img-2 (short)  │  row 1 (220px)
   │  col1 row 1-2   │  col2 row 1     │
   │                 ├─────────────────┤
   │                 │  img-4 (tall)   │  row 2 (180px)
   ├─────────────────│  col2 row 2-3   │
   │  img-3 (short)  │                 │  row 3 (180px)
   │  col1 row 3     │                 │
   └─────────────────┴─────────────────┘
   Outer overflow:hidden clips img-4 bottom bleed.

   Mobile layout (≤640px):
   ┌─────────────┬─────────────┐
   │  img-1      │  img-2      │  row 1 (150px)
   │  rows 1-2   │  row 1      │
   │             ├─────────────┤
   │             │  img-4      │  row 2 (120px)
   ├─────────────│  rows 2-3   │
   │  img-3      │             │  row 3 (120px)
   │  row 3      │             │
   └─────────────┴─────────────┘
   Same 4-slot grid, just smaller row heights.
════════════════════════════════════════════════════════════════ */

.hero-gallery {
    overflow: hidden;           /* clips img-4 bottom bleed */
    border-radius: 1.25rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 220px 180px 180px;
    gap: 0.75rem;
    width: 100%;
}

/* img-1: tall top-left, spans rows 1-2 */
.gallery-item-lg {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    border-radius: 1rem;
    overflow: hidden;
    background: #d4c5b0;
}

/* base for items 2, 3, 4 */
.gallery-item {
    border-radius: 1rem;
    overflow: hidden;
    background: #c9b99a;
}

/* img-2: short top-right, row 1 only */
.gallery-item:nth-child(2) {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}

/* img-3: short bottom-left, row 3 only */
.gallery-item:nth-child(3) {
    grid-column: 1 / 2;
    grid-row: 3 / 4;
}

/* img-4: tall bottom-right, spans rows 2-3 (bleeds below, clipped) */
.gallery-item:nth-child(4) {
    grid-column: 2 / 3;
    grid-row: 2 / 4;
    display: block;
}

/* all images fill their cell */
.gallery-item img,
.gallery-item-lg img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Products Section */
.products-section {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 1.5rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--primary-dark);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: var(--accent);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.product-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, #d2b48c 0%, #a0826d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.3);
}

.product-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.product-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.product-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.size-selector {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.size-selector span {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.size-options {
    display: flex;
    gap: 0.5rem;
}

.size-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    background: var(--bg-white);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition);
}

.size-btn:hover {
    border-color: var(--text-secondary);
}

.size-btn.selected {
    background: #111827;
    border-color: #111827;
    color: white;
}

.size-btn:disabled {
    background-color: var(--bg-light);
    color: #ccc;
    cursor: not-allowed;
    text-decoration: line-through;
    border-color: var(--border);
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.product-card .add-to-cart-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border: 1px solid transparent;
    background: var(--primary-dark);
    color: white;
    border-radius: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    transition: background var(--transition);
    transition: all var(--transition);
}

.product-card .add-to-cart-btn:hover:not(:disabled) {
    background: var(--primary-light);
}

.product-card .add-to-cart-btn:disabled {
    background: #e5e7eb;
    cursor: not-allowed;
}

.btn-out-of-stock {
    background-color: var(--error);
    border-color: var(--error);
    color: white;
    cursor: not-allowed;
}


/* Shop Section */
.shop-header {
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 2rem 1.5rem 0;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.shop-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
    flex-grow: 1;
}

.shop-filters {
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 0 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border);
    background: white;
    color: var(--text-primary);
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition);
}

.filter-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-btn.active {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

#shopProductGrid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
}

/* Cart Section */
.cart-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem 1.5rem;
}

.cart-container h2 {
    margin-bottom: 2rem;
    font-size: 2rem;
    color: var(--primary-dark);
}

.cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 1rem;
    margin-bottom: 2rem;
    gap: 1rem;
}

.cart-summary strong {
    font-size: 1.25rem;
}

.cart-items {
    display: grid;
    gap: 1.5rem;
}

.cart-item {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
}

.cart-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.cart-item-info strong {
    display: block;
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.cart-item-info span {
    color: var(--text-secondary);
}

.cart-item-variant {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.quantity-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.quantity-controls button {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--bg-light);
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: bold;
    transition: all var(--transition);
}

.quantity-controls button:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.quantity-input {
    width: 60px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.5rem;
    font-weight: 600;
}

.remove-btn {
    padding: 0.6rem 1.2rem;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    transition: background var(--transition);
}

.remove-btn:hover {
    background: #dc2626;
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state i {
    font-size: 3rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: block;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

/* Auth Section */
.auth-container {
    max-width: 400px;
    margin: 3rem auto;
    padding: 2rem 1.5rem;
}

.auth-container h2 {
    font-size: 1.875rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--primary-dark);
}

.auth-form {
    display: grid;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input {
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: border-color var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.auth-link {
    text-align: center;
    color: var(--text-secondary);
}

.auth-link a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition);
}

.auth-link a:hover {
    color: var(--primary-dark);
}

/* Alert */
.alert {
    display: none;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    position: fixed;
    top: 80px;
    left: 1.5rem;
    right: 1.5rem;
    max-width: 400px;
    margin: 0 auto;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert.show {
    display: block;
}

.alert.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* ============================================================
   Cart Drawer (slide-in from right)
   ============================================================ */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 482px;
    max-width: 100vw;
    height: 100vh;
    background: var(--bg-white);
    z-index: 400;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(15, 23, 42, 0.12);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-drawer.open {
    transform: translateX(0);
}

.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.cart-drawer-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.cart-drawer-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.375rem;
    transition: color var(--transition), background var(--transition);
    line-height: 1;
}

.cart-drawer-close:hover {
    color: var(--primary-dark);
    background: var(--bg-light);
}

.cart-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.75rem 1.5rem;
}

.drawer-cart-items {
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
}

.drawer-cart-item {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    position: relative;
    padding: 0.875rem;
    border: 1px solid var(--border);
    border-radius: 0.875rem;
    background: var(--bg-white);
}

.drawer-cart-item:last-child {
    border-bottom: 1px solid var(--border);
}

.drawer-item-img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 0.75rem;
    flex-shrink: 0;
    background: var(--bg-light);
}

.drawer-item-info {
    flex: 1;
    min-width: 0;
    padding-right: 96px;
}

.drawer-item-name {
    font-weight: 700;
    font-size: 1.125rem;
    color: #111827;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drawer-item-variant {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drawer-item-price {
    display: none;
}

.drawer-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

.drawer-item-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0;
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 9999px;
    background: var(--bg-white);
    position: absolute;
    top: 1.25rem;
    right: 0.875rem;
}

.drawer-qty-btn {
    width: 16px;
    height: 20px;
    border: none;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    color: var(--primary-dark);
    transition: background var(--transition), border-color var(--transition);
    flex-shrink: 0;
}

.drawer-qty-btn:hover {
    background: transparent;
    color: var(--accent);
}

.drawer-qty-value {
    min-width: 18px;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}

.drawer-remove-btn {
    background: none;
    border: none;
    color: var(--error);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0;
    font-weight: 500;
    margin-top: 0;
    display: inline-block;
    transition: opacity var(--transition);
    position: absolute;
    right: 1.25rem;
    bottom: 1.75rem;
}

.drawer-remove-btn:hover {
    opacity: 0.7;
}

.drawer-empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.drawer-empty-state.visible {
    display: flex;
}

.drawer-empty-state i {
    font-size: 3rem;
    opacity: 0.3;
}

.cart-drawer-footer {
    border-top: 1px solid var(--border);
    padding: 2rem 1.5rem;
    flex-shrink: 0;
    background: var(--bg-white);
    display: none;
}

.cart-drawer-footer.visible {
    display: block;
}

.cart-drawer-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

.drawer-total-amount {
    font-size: 1.625rem;
    font-weight: 700;
}

.btn-block-full {
    width: 100%;
    justify-content: center;
    border-radius: 0.75rem;
    padding: 1rem;
    font-size: 1.125rem;
}

/* ============================================================
   Checkout Page
   ============================================================ */
.checkout-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.checkout-page h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 2rem;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2.5rem;
    align-items: start;
}

.checkout-form-section {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
}

.checkout-form-section h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.checkout-form .form-group {
    margin-bottom: 1.25rem;
}

.checkout-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.checkout-form input,
.checkout-form select,
.checkout-form textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.625rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--bg-white);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    font-family: inherit;
}

.checkout-form input:focus,
.checkout-form select:focus,
.checkout-form textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.payment-method-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}

.payment-method-option:has(input:checked) {
    border-color: var(--accent);
    background: rgba(8, 145, 178, 0.04);
}

.payment-method-option input[type="radio"] {
    width: auto;
    accent-color: var(--accent);
    cursor: pointer;
}

.payment-method-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    flex: 1;
}

.payment-method-label i {
    font-size: 1.3rem;
    width: 24px;
    text-align: center;
    color: var(--accent);
}

/* Order Summary Sidebar */
.checkout-summary {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.75rem;
    position: sticky;
    top: 90px;
}

.checkout-summary h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.summary-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-item {
    display: flex;
    gap: 0.875rem;
    align-items: center;
}

.summary-item-img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 0.5rem;
    background: var(--bg-light);
    flex-shrink: 0;
}

.summary-item-name {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

.summary-item-qty {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.summary-item-price {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-dark);
    white-space: nowrap;
}

.summary-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1rem 0;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}

.summary-line.total {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.checkout-submit-btn {
    width: 100%;
    justify-content: center;
    margin-top: 1.5rem;
    border-radius: 0.75rem;
    padding: 1rem;
    font-size: 1rem;
}

.checkout-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.checkout-empty i {
    font-size: 3rem;
    opacity: 0.3;
    display: block;
    margin-bottom: 1rem;
}

/* Success Modal */
.order-success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.order-success-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.order-success-modal {
    background: var(--bg-white);
    border-radius: 1.5rem;
    padding: 2.5rem;
    max-width: 460px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.order-success-overlay.active .order-success-modal {
    transform: scale(1);
}

.success-icon {
    width: 72px;
    height: 72px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: var(--success);
}

.order-success-modal h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
}

.order-success-modal p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.order-number-badge {
    display: inline-block;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary-dark);
    margin: 1rem 0 1.5rem;
    letter-spacing: 0.05em;
}

.pincode-validation-message {
    font-size: 0.8rem;
    margin-top: 0.35rem;
    height: 1.2em; /* Reserve space to prevent layout shift */
}
.pincode-validation-message.loading {
    color: var(--text-secondary);
}
.pincode-validation-message.success {
    color: var(--success);
}
.pincode-validation-message.invalid,
.pincode-validation-message.error {
    color: var(--error);
}

@media (max-width: 900px) {
    .checkout-grid {
        grid-template-columns: 1fr;
    }

    .checkout-summary {
        position: static;
        order: -1;
    }
}

@media (max-width: 640px) {
    .cart-drawer {
        width: 100vw;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .checkout-page {
        padding: 1.5rem 1rem 3rem;
    }
}

.hidden {
    display: none !important;
}

/* Footer */
.footer {
    background: var(--bg-light);
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-column h3,
.footer-column h4 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.footer-column p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.footer-column ul {
    list-style: none;
}

.footer-column li {
    margin-bottom: 0.75rem;
}

.footer-column a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition);
}

.footer-column a:hover {
    color: var(--accent);
}

.footer-icons {
    display: flex;
    gap: 1rem;
}

.footer-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 0.5rem;
    color: var(--primary-dark);
    text-decoration: none;
    transition: all var(--transition);
}

.footer-icon:hover {
    background: var(--primary-dark);
    color: white;
}

.footer-bottom {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.admin-panel-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: minmax(320px, 420px) 1fr;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
}

.admin-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.form-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.admin-table-wrapper {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 0.95rem 0.75rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    font-weight: 700;
    background: var(--bg-light);
}

.admin-thumb,
.cart-item-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.75rem;
}

.text-secondary {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.admin-wide-card {
    max-width: 1200px;
    margin: 0 auto;
}

.admin-order-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.admin-order-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.admin-order-header strong {
    font-size: 1.1rem;
}
.admin-order-header span {
    text-transform: capitalize;
    font-weight: 600;
    color: var(--text-secondary);
}

.admin-order-meta {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.admin-order-meta span {
    margin-right: 0.5rem;
}

.admin-order-details {
    padding-top: 1rem;
    transition: all 0.3s ease;
}

.admin-order-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.admin-order-customer-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.admin-order-customer-info p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.order-item-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.order-item-row img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.75rem;
}

.admin-order-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-top: 1.5rem;
}

.order-status-select {
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    font-size: 1rem;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-item-thumb {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 1rem;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════
   Responsive Design
═══════════════════════════════════════════════════ */

/* ── Tablet (≤768px): stack hero text above gallery ── */
@media (max-width: 768px) {
    .navbar-container {
        padding: 1rem 1.5rem;
        gap: 1rem;
    }

    .navbar-menu {
        gap: 1.5rem;
        font-size: 0.875rem;
    }

    .navbar-icons {
        gap: 1rem;
    }

    /* Stack hero vertically: text on top, gallery below */
    .hero {
        grid-template-columns: 1fr;
        padding: 2rem 1.25rem 2.5rem;
        gap: 2rem;
    }

    /* Gallery stays as 2-column grid but with smaller rows */
    .gallery-grid {
        grid-template-columns: 1fr 1fr;   /* KEEP 2 cols — never single col */
        grid-template-rows: 180px 145px 145px;
        gap: 0.625rem;
    }

    .gallery-item-lg,
    .gallery-item {
        border-radius: 0.875rem;
    }

    .hero-gallery {
        border-radius: 0.875rem;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    .cart-summary {
        flex-direction: column;
        text-align: center;
    }

    .alert {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
}

/* ── Mobile (≤640px): smaller gallery rows, hide nav menu ── */
@media (max-width: 640px) {
    .navbar-brand h1 {
        font-size: 1.25rem;
    }

    .navbar-menu {
        display: none;
    }

    .hero {
        padding: 1.5rem 1rem 2rem;
        gap: 1.5rem;
    }

    .hero-title {
        font-size: 2.25rem;
        line-height: 1.1;
    }

    .hero-description {
        font-size: 0.95rem;
    }

    /* Mobile gallery: 2-col grid with compact rows */
    .gallery-grid {
        grid-template-columns: 1fr 1fr;   /* KEEP 2 cols */
        grid-template-rows: 150px 120px 120px;
        gap: 0.5rem;
    }

    .gallery-item-lg,
    .gallery-item {
        border-radius: 0.75rem;
    }

    .hero-gallery {
        border-radius: 0.75rem;
    }

    /* On mobile the Shop Now btn fills full width */
    #shopBtn {
        width: 100%;
        justify-content: center;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .cart-item-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .quantity-controls {
        width: 100%;
        justify-content: space-between;
    }
}

/* ── Very small phones (≤400px) ── */
@media (max-width: 400px) {
    .hero-title {
        font-size: 1.875rem;
    }

    .gallery-grid {
        grid-template-rows: 130px 105px 105px;
        gap: 0.4rem;
    }

    .navbar-icons {
        gap: 0.75rem;
    }
}
