/* American Tropical Wood - Styles */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Work+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --mahogany: #4A2020;
    --mahogany-light: #6B3030;
    --walnut: #5D4037;
    --teak: #B8860B;
    --teak-light: #DAA520;
    --oak-light: #DEB887;
    --cream: #FDF5E6;
    --parchment: #F5F0E6;
    --charcoal: #2C2416;
    --forest: #2D4A3E;
    --forest-light: #3D6A5E;
    --success: #4A7C59;
    --warning: #C17817;
    --danger: #8B2500;
    --info: #2E5A6B;
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Work Sans', -apple-system, sans-serif;
    --shadow-md: 0 4px 12px rgba(44, 36, 22, 0.12);
    --shadow-lg: 0 8px 24px rgba(44, 36, 22, 0.16);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); font-size: 16px; line-height: 1.6; color: var(--charcoal); background: var(--parchment); min-height: 100vh; }
a { color: var(--forest); text-decoration: none; }
a:hover { color: var(--teak); }

.wood-texture {
    background: repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(139,90,43,0.02) 2px, rgba(139,90,43,0.02) 4px),
        linear-gradient(180deg, var(--parchment) 0%, #EDE5D8 50%, var(--parchment) 100%);
}

h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 600; color: var(--mahogany); line-height: 1.3; }
.container { max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; }
.page-content { padding: 2rem 0; }

/* Header */
.site-header { background: linear-gradient(135deg, var(--mahogany) 0%, var(--walnut) 100%); color: var(--cream); padding: 1rem 0; position: sticky; top: 0; z-index: 1000; box-shadow: var(--shadow-lg); }
.header-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.logo { display: flex; align-items: center; gap: 1rem; }
.logo-icon { width: 50px; height: 50px; background: var(--teak); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.logo-text h1 { font-size: 1.5rem; color: var(--cream); margin-bottom: 0; }
.logo-text .tagline { font-size: 0.75rem; opacity: 0.85; letter-spacing: 1px; text-transform: uppercase; }
.header-nav { display: flex; gap: 0.5rem; }
.header-nav a { color: var(--cream); padding: 0.5rem 1rem; border-radius: 6px; font-size: 0.9rem; }
.header-nav a:hover { background: rgba(255,255,255,0.15); color: var(--cream); }
.header-contact { text-align: right; font-size: 0.85rem; }
.header-contact a { color: var(--teak-light); }

/* Filter Bar */
.filter-bar { background: var(--cream); padding: 1rem 1.5rem; border-bottom: 2px solid var(--oak-light); position: sticky; top: 70px; z-index: 100; }
.filter-bar-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; max-width: 1400px; margin: 0 auto; }
.filter-group { display: flex; align-items: center; gap: 0.75rem; }
.filter-group label { font-weight: 600; color: var(--walnut); font-size: 0.85rem; text-transform: uppercase; }
.filter-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filter-btn { background: transparent; border: 2px solid var(--oak-light); padding: 0.4rem 1rem; border-radius: 6px; font-family: var(--font-body); font-size: 0.85rem; font-weight: 500; color: var(--walnut); cursor: pointer; text-decoration: none; }
.filter-btn:hover { border-color: var(--teak); color: var(--teak); }
.filter-btn.active { background: var(--mahogany); border-color: var(--mahogany); color: var(--cream); }
.view-toggle { display: flex; gap: 0.25rem; background: var(--parchment); padding: 0.25rem; border-radius: 6px; }
.view-btn { background: transparent; border: none; padding: 0.5rem 0.75rem; border-radius: 4px; cursor: pointer; font-size: 1.1rem; color: var(--walnut); text-decoration: none; }
.view-btn:hover { color: var(--teak); }
.view-btn.active { background: var(--mahogany); color: var(--cream); }

/* Cards */
.card { background: var(--cream); border-radius: 10px; box-shadow: var(--shadow-md); overflow: hidden; border: 1px solid rgba(139,90,43,0.1); transition: transform 0.25s, box-shadow 0.25s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-header { background: linear-gradient(135deg, var(--walnut) 0%, var(--mahogany-light) 100%); color: var(--cream); padding: 1.25rem; position: relative; }
.card-body { padding: 1.25rem; }
.card-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--oak-light); background: var(--parchment); }
.card.featured { border: 2px solid var(--teak); }
.featured-badge { position: absolute; top: 0.75rem; right: 0.75rem; background: var(--teak); color: var(--charcoal); padding: 0.2rem 0.6rem; border-radius: 4px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; }

/* Products */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 1.5rem; }
.products-list .product-card { display: grid; grid-template-columns: 250px 1fr; }
.product-category { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; opacity: 0.8; margin-bottom: 0.25rem; }
.product-name { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; line-height: 1.3; color: inherit; margin-bottom: 0.25rem; }
.product-sku { font-size: 0.75rem; opacity: 0.7; font-family: monospace; }
.product-description { color: var(--walnut); font-size: 0.9rem; line-height: 1.5; margin-bottom: 1rem; }
.product-specs { background: var(--parchment); border-radius: 6px; padding: 0.75rem; margin-bottom: 1rem; }
.product-specs h4 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--walnut); margin-bottom: 0.5rem; }
.specs-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.25rem 1rem; font-size: 0.8rem; }
.spec-item { display: flex; justify-content: space-between; }
.spec-label { color: #666; }
.spec-value { font-weight: 500; }

/* Pricing */
.product-pricing { margin-bottom: 1rem; }
.base-price { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.75rem; }
.price-amount { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; color: var(--mahogany); }
.price-unit { font-size: 0.85rem; color: #666; }
.qty-pricing { background: linear-gradient(135deg, #F8F4EE 0%, var(--parchment) 100%); border-radius: 6px; padding: 0.75rem; border: 1px solid var(--oak-light); }
.qty-pricing h5 { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--walnut); margin-bottom: 0.5rem; }
.qty-tiers { display: grid; gap: 0.2rem; }
.qty-tier { display: flex; justify-content: space-between; align-items: center; padding: 0.2rem 0.4rem; background: rgba(255,255,255,0.5); border-radius: 4px; font-size: 0.8rem; }
.tier-range { color: #666; }
.tier-price { font-weight: 600; color: var(--forest); }
.tier-price .discount { font-size: 0.7rem; color: var(--success); margin-left: 0.5rem; }

/* Inventory Status */
.inventory-status { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; border-radius: 6px; margin-bottom: 1rem; border-left: 4px solid var(--success); background: #F0F7F4; }
.inventory-status.low-stock { background: #FFF8E7; border-left-color: var(--warning); }
.inventory-status.out-of-stock { background: #FEF2F0; border-left-color: var(--danger); }
.status-indicator { width: 10px; height: 10px; border-radius: 50%; background: var(--success); animation: pulse 2s infinite; }
.inventory-status.low-stock .status-indicator { background: var(--warning); }
.inventory-status.out-of-stock .status-indicator { background: var(--danger); animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.status-text { flex: 1; }
.status-label { font-weight: 600; font-size: 0.85rem; }
.status-qty { font-size: 0.75rem; color: #666; }

/* Distribution */
.distribution-info { border-top: 1px solid var(--oak-light); padding-top: 1rem; }
.distribution-info h4 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--walnut); margin-bottom: 0.5rem; }
.shipping-origin { font-size: 0.85rem; margin-bottom: 0.5rem; }
.locations-served { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-bottom: 0.5rem; }
.location-tag { background: var(--parchment); border: 1px solid var(--oak-light); padding: 0.1rem 0.5rem; border-radius: 20px; font-size: 0.7rem; color: var(--walnut); }
.shipping-notes { font-size: 0.8rem; color: #666; font-style: italic; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.6rem 1.25rem; border: none; border-radius: 6px; font-family: var(--font-body); font-size: 0.9rem; font-weight: 600; cursor: pointer; text-decoration: none; transition: all 0.15s; white-space: nowrap; }
.btn-primary { background: var(--mahogany); color: var(--cream); }
.btn-primary:hover { background: var(--mahogany-light); color: var(--cream); }
.btn-secondary { background: var(--forest); color: var(--cream); }
.btn-secondary:hover { background: var(--forest-light); color: var(--cream); }
.btn-outline { background: transparent; border: 2px solid var(--mahogany); color: var(--mahogany); }
.btn-outline:hover { background: var(--mahogany); color: var(--cream); }
.btn-danger { background: var(--danger); color: var(--cream); }
.btn-danger:hover { background: #A52D00; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; font-size: 0.8rem; color: var(--walnut); margin-bottom: 0.35rem; text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.6rem 0.9rem; border: 2px solid var(--oak-light); border-radius: 6px; font-family: var(--font-body); font-size: 0.95rem; background: white; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--teak); box-shadow: 0 0 0 3px rgba(184,134,11,0.15); }
.form-group textarea { min-height: 100px; resize: vertical; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

/* Tables */
.table-wrapper { overflow-x: auto; border-radius: 8px; box-shadow: var(--shadow-md); }
.data-table { width: 100%; border-collapse: collapse; background: var(--cream); font-size: 0.9rem; }
.data-table th, .data-table td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid var(--oak-light); }
.data-table th { background: var(--parchment); font-weight: 600; color: var(--walnut); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px; }
.data-table tr:hover { background: rgba(222,184,135,0.1); }
.data-table .actions { display: flex; gap: 0.5rem; justify-content: flex-end; }
.data-table code { background: var(--parchment); padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.8rem; }

/* Status Badges */
.status-badge { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.25rem 0.65rem; border-radius: 20px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pending { background: #FEF3CD; color: #856404; }
.status-confirmed { background: #D4EDDA; color: #155724; }
.status-processing { background: #D1ECF1; color: #0C5460; }
.status-shipped { background: #CCE5FF; color: #004085; }
.status-delivered { background: #D4EDDA; color: #155724; }
.status-cancelled { background: #F8D7DA; color: #721C24; }
.status-hold { background: #E2E3E5; color: #383D41; }

/* Alerts */
.alert { padding: 1rem 1.25rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-success { background: #D4EDDA; color: #155724; border: 1px solid #C3E6CB; }
.alert-error { background: #F8D7DA; color: #721C24; border: 1px solid #F5C6CB; }
.alert-warning { background: #FFF3CD; color: #856404; border: 1px solid #FFEEBA; }
.alert-info { background: #D1ECF1; color: #0C5460; border: 1px solid #BEE5EB; }

/* Admin Layout */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 260px; background: linear-gradient(180deg, var(--charcoal) 0%, var(--mahogany) 100%); color: var(--cream); position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 1000; }
.sidebar-header { padding: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-header h1 { font-size: 1.25rem; color: var(--cream); margin-bottom: 0.25rem; }
.sidebar-header span { font-size: 0.75rem; opacity: 0.7; }
.sidebar-nav { padding: 1rem 0; }
.sidebar-nav a { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 1.5rem; color: rgba(255,255,255,0.8); font-size: 0.9rem; border-left: 3px solid transparent; }
.sidebar-nav a:hover { background: rgba(255,255,255,0.1); color: var(--cream); }
.sidebar-nav a.active { background: rgba(255,255,255,0.15); color: var(--teak-light); border-left-color: var(--teak); }
.sidebar-nav .nav-section { padding: 1rem 1.5rem 0.5rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.5); }
.admin-main { flex: 1; margin-left: 260px; min-height: 100vh; background: var(--parchment); }
.admin-header { background: var(--cream); padding: 1rem 1.5rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--oak-light); position: sticky; top: 0; z-index: 100; }
.admin-header h2 { font-size: 1.5rem; margin: 0; }
.admin-content { padding: 1.5rem; }

/* Sections */
.section { background: var(--cream); border-radius: 10px; padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: var(--shadow-md); }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 2px solid var(--oak-light); }
.section-header h3 { margin: 0; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--cream); border-radius: 10px; padding: 1.25rem; box-shadow: var(--shadow-md); border-left: 4px solid var(--teak); }
.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.danger { border-left-color: var(--danger); }
.stat-card.info { border-left-color: var(--info); }
.stat-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--walnut); margin-bottom: 0.5rem; }
.stat-value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--mahogany); line-height: 1; }

/* Order Form */
.order-form { background: var(--cream); border-radius: 10px; box-shadow: var(--shadow-lg); overflow: hidden; }
.order-form-header { background: linear-gradient(135deg, var(--forest) 0%, var(--forest-light) 100%); color: var(--cream); padding: 1.5rem; }
.order-form-header h2 { color: var(--cream); margin: 0 0 0.5rem 0; }
.order-form-header p { margin: 0; opacity: 0.9; }
.order-form-body { padding: 1.5rem; }

/* CART ITEMS - FIXED LAYOUT */
.cart-items { margin-bottom: 1.5rem; }

.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--parchment);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.cart-item-info {
    flex: 1;
    min-width: 200px;
}

.cart-item-name { font-weight: 600; margin-bottom: 0.25rem; }
.cart-item-sku { font-size: 0.8rem; color: #666; }

.cart-item-price {
    color: var(--walnut);
    white-space: nowrap;
    min-width: 120px;
}

.cart-item-qty-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-qty-input {
    width: 80px !important;
    text-align: center;
    padding: 0.4rem;
    border: 2px solid var(--oak-light);
    border-radius: 6px;
    font-size: 0.95rem;
}

.cart-item-total {
    font-weight: 700;
    color: var(--mahogany);
    min-width: 90px;
    text-align: right;
}

.cart-item-remove-form {
    display: flex;
}

.btn-remove {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.25rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.btn-remove:hover {
    background: #A52D00;
}

@media (max-width: 768px) {
    .cart-item {
        flex-direction: column;
        align-items: stretch;
    }
    .cart-item-info { min-width: auto; }
    .cart-item-price { text-align: left; }
    .cart-item-total { text-align: left; }
    .cart-item-qty-form { justify-content: flex-start; }
}

/* Order Summary */
.order-summary { background: var(--parchment); border-radius: 8px; padding: 1.25rem; margin-top: 1.5rem; }
.order-summary-row { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid var(--oak-light); }
.order-summary-row:last-child { border-bottom: none; font-weight: 700; font-size: 1.1rem; padding-top: 0.75rem; }

/* Customer Portal */
.customer-header { background: linear-gradient(135deg, var(--forest) 0%, var(--forest-light) 100%); color: var(--cream); padding: 2rem; text-align: center; }
.customer-header h1 { color: var(--cream); margin-bottom: 0.5rem; }

.order-status-timeline { display: flex; justify-content: space-between; margin: 2rem 0; position: relative; }
.order-status-timeline::before { content: ''; position: absolute; top: 15px; left: 0; right: 0; height: 4px; background: var(--oak-light); z-index: 0; }
.timeline-step { display: flex; flex-direction: column; align-items: center; position: relative; z-index: 1; }
.timeline-step .step-icon { width: 34px; height: 34px; border-radius: 50%; background: var(--oak-light); display: flex; align-items: center; justify-content: center; font-size: 1rem; margin-bottom: 0.5rem; }
.timeline-step.completed .step-icon { background: var(--success); color: white; }
.timeline-step.current .step-icon { background: var(--teak); color: white; box-shadow: 0 0 0 4px rgba(184,134,11,0.3); }
.timeline-step .step-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--walnut); }

/* Notes */
.notes-list { margin-top: 1rem; }
.note-item { padding: 1rem; background: var(--parchment); border-radius: 8px; margin-bottom: 0.75rem; border-left: 3px solid var(--teak); }
.note-item.internal { border-left-color: var(--info); background: #F0F7FA; }
.note-header { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.8rem; color: #666; }
.note-content { font-size: 0.9rem; }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 2000; opacity: 0; visibility: hidden; transition: opacity 0.25s, visibility 0.25s; }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal { background: var(--cream); border-radius: 12px; max-width: 600px; width: 90%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { background: linear-gradient(135deg, var(--walnut) 0%, var(--mahogany-light) 100%); color: var(--cream); padding: 1.25rem; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { color: var(--cream); margin: 0; }
.modal-close { background: none; border: none; color: var(--cream); font-size: 1.5rem; cursor: pointer; opacity: 0.8; padding: 0; line-height: 1; }
.modal-close:hover { opacity: 1; }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--oak-light); display: flex; justify-content: flex-end; gap: 0.75rem; }

/* Footer */
.site-footer { background: linear-gradient(135deg, var(--charcoal) 0%, var(--mahogany) 100%); color: var(--cream); padding: 2.5rem 1.5rem 1.5rem; margin-top: 3rem; }
.footer-content { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; }
.footer-section h3 { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 1rem; color: var(--teak-light); }
.footer-section p, .footer-section a { font-size: 0.85rem; line-height: 1.8; color: rgba(255,255,255,0.75); }
.footer-section a:hover { color: var(--teak-light); }
.footer-bottom { max-width: 1400px; margin: 2rem auto 0; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,0.1); text-align: center; font-size: 0.8rem; opacity: 0.6; }

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #666; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.gap-md { gap: 1rem; }
.align-center { align-items: center; }

/* Charts */
.chart-container { background: var(--cream); border-radius: 10px; padding: 1.5rem; box-shadow: var(--shadow-md); margin-bottom: 1.5rem; }
.chart-container h4 { margin: 0 0 1rem 0; }

@media (max-width: 992px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-main { margin-left: 0; }
}
