:root {
    --primary: #d97706; /* Amber 600 */
    --primary-light: #fef3c7; /* Amber 100 */
    --secondary: #92400e; /* Amber 900 */
    --bg: #f9fafb;
    --white: #ffffff;
    --text: #1f2937;
    --text-light: #6b7280;
    --success: #10b981;
    --green: #16a34a; /* Touche de vert (Fresh Green) */
    --danger: #ef4444;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg: #111827 !important;
    --white: #1f2937 !important;
    --text: #f3f4f6 !important;
    --text-light: #9ca3af !important;
    --primary-light: #451a03 !important;
    --secondary: #fbbf24 !important;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5) !important;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Roboto, Helvetica, sans-serif; }

body { background-color: var(--bg); color: var(--text); padding-bottom: 50px; }

/* Layout */
.container { max-width: 96%; margin: 0 auto; padding: 0 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.hidden { display: none !important; }

/* Header */
header { background: var(--primary); color: var(--white); padding: 1rem 0; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow); }
.header-content { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 1.5rem; font-weight: bold; }
.logo-img { height: 45px; width: 45px; background: white; border-radius: 50%; padding: 5px; object-fit: contain; }
.controls { display: flex; gap: 15px; align-items: center; }

/* Buttons & Inputs */
#lang-switch {
    appearance: none;
    -webkit-appearance: none;
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--white);
    padding: 8px 35px 8px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    transition: all 0.2s;
}

#lang-switch:hover { background-color: rgba(255, 255, 255, 0.3); border-color: rgba(255, 255, 255, 0.5); }
#lang-switch:focus { outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2); }
#lang-switch option { background-color: var(--white); color: var(--text); }

.cart-btn { background: rgba(255,255,255,0.2); border: none; color: white; padding: 10px; border-radius: 50%; position: relative; cursor: pointer; transition: 0.2s; }
.cart-btn:hover { background: rgba(255,255,255,0.3); }
.cart-btn span { position: absolute; top: -5px; right: -5px; background: var(--danger); color: white; font-size: 0.7rem; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; }

.btn-primary { background: var(--text); color: var(--bg); border: none; padding: 10px 20px; border-radius: var(--radius); cursor: pointer; width: 100%; font-weight: bold; transition: 0.2s; }
.btn-primary:hover { opacity: 0.8; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-danger-outline { width: 100%; padding: 10px; margin-bottom: 10px; border: 1px solid var(--danger); color: var(--danger); background: transparent; border-radius: var(--radius); cursor: pointer; font-weight: bold; transition: 0.2s; }
.btn-danger-outline:hover { background: var(--danger); color: white; }

.btn-success { background: var(--success); color: white; border: none; padding: 15px; border-radius: var(--radius); width: 100%; font-size: 1.1rem; font-weight: bold; cursor: pointer; }
.btn-success:hover { background: #059669; }

/* Hero */
.hero { text-align: center; padding: 15px 20px; background: var(--primary-light); color: var(--secondary); margin-bottom: 10px; }
.hero h2 { font-size: 1.8rem; margin-bottom: 5px; }

/* Tabs */
.tabs { display: flex; justify-content: center; gap: 20px; margin-bottom: 15px; border-bottom: 2px solid #e5e7eb; }
.tab-btn { background: none; border: none; padding: 10px 20px; font-size: 1.1rem; cursor: pointer; color: var(--text-light); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tab-btn.active { color: var(--primary); border-color: var(--primary); font-weight: bold; }

/* Cards */
.card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform 0.2s; border: 1px solid #f3f4f6; }
.card:hover { transform: translateY(-5px); }
.card-img { height: 150px; background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 4rem; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 20px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.card-price { color: var(--green); font-weight: bold; font-size: 1.2rem; }
.card-desc { color: var(--text-light); font-size: 0.9rem; margin-bottom: 15px; height: 40px; }

/* Builder */
.builder-card { background: var(--white); padding: 30px; border-radius: var(--radius); box-shadow: var(--shadow); max-width: 800px; margin: 0 auto; }
.step { margin-bottom: 25px; }
.step h4 { margin-bottom: 10px; color: var(--secondary); }
.options-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.option-btn { border: 2px solid #e5e7eb; background: var(--white); padding: 10px; border-radius: 8px; cursor: pointer; text-align: left; transition: 0.2s; }
.option-btn:hover { border-color: var(--primary-light); }
.option-btn.selected { border-color: var(--primary); background: var(--primary-light); }
.option-price { font-size: 0.8rem; color: var(--text-light); display: block; margin-top: 5px; }
.builder-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; padding-top: 20px; border-top: 1px solid #e5e7eb; }
.price-display { font-size: 1.5rem; font-weight: bold; color: var(--primary); }

/* Type Selector (Sandwich/Salad) */
.type-selector { display: flex; justify-content: center; gap: 10px; margin-bottom: 25px; }
.type-btn { padding: 10px 30px; border-radius: 25px; border: 1px solid #e5e7eb; background: var(--white); cursor: pointer; font-weight: bold; color: var(--text-light); transition: 0.2s; font-size: 1rem; }
.type-btn.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

/* Payment Options */
.payment-options { margin-bottom: 15px; padding: 10px; background: var(--bg); border-radius: var(--radius); border: 1px solid #e5e7eb; }
.payment-label { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-bottom: 5px; font-size: 0.95rem; }
.payment-label input { accent-color: var(--primary); width: 18px; height: 18px; }
.payment-warning { color: var(--danger); font-size: 0.8rem; margin-top: 5px; font-weight: 600; }

/* Fulfillment Options */
.fulfillment-options { margin-bottom: 15px; padding: 10px; background: var(--bg); border-radius: var(--radius); border: 1px solid #e5e7eb; }
.cart-input { width: 100%; padding: 8px; border-radius: 8px; border: 1px solid #e5e7eb; background: var(--white); color: var(--text); font-family: inherit; }

/* Custom Textarea */
.custom-textarea {
    width: 100%;
    padding: 15px;
    border-radius: var(--radius);
    border: 1px solid #e5e7eb;
    resize: vertical;
    min-height: 150px;
    font-family: inherit;
    margin-bottom: 20px;
    background: var(--white);
    color: var(--text);
}
.custom-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1); }

/* Cart Comment */
.cart-textarea {
    width: 100%;
    padding: 10px;
    border-radius: var(--radius);
    border: 1px solid #e5e7eb;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
    margin-bottom: 15px;
    background: var(--white);
    color: var(--text);
    font-size: 0.9rem;
}
.cart-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1); }

/* Sidebar Cart */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 199; }
.sidebar { position: fixed; top: 0; right: 0; width: 100%; max-width: 400px; height: 100%; background: var(--white); z-index: 200; box-shadow: -5px 0 15px rgba(0,0,0,0.1); display: flex; flex-direction: column; animation: slideIn 0.3s; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

.sidebar-header { padding: 20px; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: space-between; align-items: center; background: var(--primary-light); }
.sidebar-header button { background: none; border: none; font-size: 1.5rem; cursor: pointer; }
.cart-items { flex: 1; overflow-y: auto; padding: 20px; }
.cart-item { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid #f3f4f6; }
.item-info h4 { font-size: 1rem; }
.item-info p { font-size: 0.8rem; color: var(--text-light); }
.remove-btn { color: var(--danger); background: none; border: none; cursor: pointer; padding: 5px; }
.sidebar-footer { padding: 20px; border-top: 1px solid #e5e7eb; background: var(--bg); }
.total-row { display: flex; justify-content: space-between; font-size: 1.2rem; font-weight: bold; margin-bottom: 15px; }

/* Filters (Categories) */
.menu-controls { display: flex; justify-content: center; align-items: center; gap: 15px; margin-bottom: 20px; flex-wrap: wrap; }
.filters { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.filter-btn { padding: 8px 20px; border-radius: 25px; border: 1px solid #e5e7eb; background: var(--white); cursor: pointer; transition: 0.2s; color: var(--text-light); font-weight: 600; font-size: 0.95rem; }
.filter-btn:hover { border-color: var(--green); color: var(--green); }
.filter-btn.active { background: var(--green); color: white; border-color: var(--green); box-shadow: 0 2px 4px rgba(22, 163, 74, 0.2); }

/* Search Bar */
.search-input { padding: 8px 20px; border-radius: 25px; border: 1px solid #e5e7eb; outline: none; width: 200px; font-size: 0.95rem; transition: 0.2s; color: var(--text); background: var(--white); }
.search-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1); }

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .logo h1 { display: none; }
    .controls { gap: 5px; }
    .container { padding: 0 10px; }
    #lang-switch { padding: 5px 25px 5px 10px; font-size: 0.8rem; }
}

/* Modal Settings */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 201;
    width: 90%;
    max-width: 400px;
    border: 1px solid #e5e7eb;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h3 { color: var(--text); }
.modal-header button { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text); }
.modal-body { margin-bottom: 25px; }
.settings-tabs { display: flex; gap: 10px; margin-bottom: 20px; border-bottom: 1px solid #e5e7eb; padding-bottom: 10px; }
.settings-tab-btn { background: none; border: none; padding: 5px 10px; cursor: pointer; color: var(--text-light); font-weight: 600; border-bottom: 2px solid transparent; transition: 0.2s; }
.settings-tab-btn:hover { color: var(--primary); }
.settings-tab-btn.active { color: var(--primary); border-color: var(--primary); }
.settings-panel { display: none; flex-direction: column; gap: 15px; }
.settings-panel.active { display: flex; }
.color-option { display: flex; justify-content: space-between; align-items: center; }
.color-option label { font-weight: 600; color: var(--text); }
.color-option input[type="color"] { border: none; width: 40px; height: 40px; cursor: pointer; background: none; padding: 0; border-radius: 50%; overflow: hidden; }
.modal-footer { text-align: center; }

/* Settings Product List */
.settings-list { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.settings-item { display: flex; justify-content: space-between; align-items: center; padding: 10px; background: var(--bg); border-radius: 8px; border: 1px solid #e5e7eb; }
.settings-item-info { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 0.9rem; }
.settings-item-actions { display: flex; gap: 5px; }
.btn-icon { background: none; border: none; cursor: pointer; font-size: 1.1rem; padding: 5px; border-radius: 4px; transition: 0.2s; }
.btn-icon.edit { color: var(--primary); }
.btn-icon.delete { color: var(--danger); }
.btn-icon:hover { background: rgba(0,0,0,0.05); }
.mb-2 { margin-bottom: 10px; }

/* Emoji Picker */
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 5px; max-height: 150px; overflow-y: auto; padding: 5px; border: 1px solid #e5e7eb; border-radius: 8px; background: var(--bg); margin-bottom: 10px; }
.emoji-btn { font-size: 1.5rem; cursor: pointer; background: var(--white); border: 1px solid transparent; border-radius: 4px; display: flex; justify-content: center; align-items: center; height: 40px; transition: 0.2s; }
.emoji-btn:hover { background: var(--primary-light); transform: scale(1.1); }
.emoji-btn.selected { background: var(--primary-light); border-color: var(--primary); }

/* Loyalty Card */
.stamps-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 10px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid #e5e7eb;
}
.stamp {
    width: 100%;
    padding-bottom: 100%; /* Creates a square aspect ratio */
    border-radius: 50%;
    background-color: var(--white);
    border: 3px dashed var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    transition: all 0.3s ease-in-out;
}
.stamp.filled {
    background-color: var(--primary);
    border-style: solid;
    border-color: var(--secondary);
    color: var(--white);
    transform: scale(1.05);
}
.stamp.filled::before {
    content: '🥪'; /* Sandwich emoji */
}

/* Admin Table */
.orders-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.orders-table th, .orders-table td { padding: 12px; text-align: left; border-bottom: 1px solid #e5e7eb; }
.orders-table th { background-color: var(--bg); font-weight: bold; color: var(--text); }
