/* =====================================================
   FreshEurope - Design System
   Palette: Vert/Jaune Doré - Moderne
   ===================================================== */

/* ---- CSS Variables ---- */
:root {
    --primary: #2D5016;
    --primary-light: #4CAF50;
    --primary-dark: #1B3A0A;
    --accent: #FFD700;
    --accent-dark: #E6C200;
    --accent-light: #FFF3B0;
    --success: #28A745;
    --warning: #FFC107;
    --danger: #DC3545;
    --info: #17A2B8;

    --bg: #FFFFFF;
    --bg-alt: #F8F9FA;
    --bg-card: #FFFFFF;
    --text: #1A1A1A;
    --text-muted: #6C757D;
    --text-light: #ADB5BD;
    --border: #E2E8F0;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 4px;
    --transition: 0.2s ease;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --navbar-height: 70px;
}

/* Dark mode */
[data-theme="dark"] {
    --bg: #0F1A0A;
    --bg-alt: #1A2A12;
    --bg-card: #1E2E16;
    --text: #E8F5E9;
    --text-muted: #A5D6A7;
    --text-light: #66BB6A;
    --border: #2E4A20;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
    --primary-light: #66BB6A;
}

/* ---- Accessibility ---- */
.skip-to-content { position: absolute; top: -100%; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; padding: 8px 24px; border-radius: 0 0 var(--radius-sm) var(--radius-sm); z-index: 9999; font-weight: 600; }
.skip-to-content:focus { top: 0; color: #fff; }

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
    scroll-behavior: smooth;
    height: 100%;
}
body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: var(--primary-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

main {
    flex: 1 0 auto;
    display: block;
}

/* ---- Layout ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section-padding { padding: 60px 0; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger) !important; }
.mb-05 { margin-bottom: 8px; }
.mb-1 { margin-bottom: 16px; }
.mb-2 { margin-bottom: 32px; }
.mb-3 { margin-bottom: 48px; }
.mt-1 { margin-top: 16px; }
.mt-2 { margin-top: 32px; }

/* ---- Typography ---- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; color: var(--text); }
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.15rem; }
.section-title {
    font-size: 2rem;
    margin-bottom: 8px;
}
.section-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.2;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-accent { background: var(--accent); color: var(--primary-dark); border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #c82333; border-color: #c82333; color: #fff; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 16px 32px; font-size: 1.1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}
.icon-btn:hover { background: var(--bg-alt); color: var(--primary-light); }

/* ---- Navbar ---- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    height: var(--navbar-height);
}
.navbar-inner {
    display: flex;
    align-items: center;
    height: var(--navbar-height);
    gap: 24px;
}
.navbar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    flex-shrink: 0;
}
.navbar-logo:hover { color: var(--text); }
.logo-accent { color: var(--primary-light); }
[data-theme="dark"] .logo-accent { color: var(--accent); }

.navbar-search { flex: 1; max-width: 480px; position: relative; }
.search-form { position: relative; }
.search-form input {
    width: 100%;
    padding: 10px 44px 10px 16px;
    border: 2px solid var(--border);
    border-radius: 50px;
    background: var(--bg-alt);
    color: var(--text);
    font-size: 0.9rem;
    transition: all var(--transition);
}
.search-form input:focus {
    outline: none;
    border-color: var(--primary-light);
    background: var(--bg);
    box-shadow: 0 0 0 3px rgba(76,175,80,0.15);
}
.search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition);
}
.search-btn:hover { background: var(--primary-dark); }

.search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: none;
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
}
.search-dropdown.active { display: block; }
.search-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    transition: background var(--transition);
}
.search-dropdown-item:hover { background: var(--bg-alt); }
.search-dropdown-item img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-xs);
    object-fit: cover;
}
.search-dropdown-item .search-item-name { font-weight: 500; }
.search-dropdown-item .search-item-price { color: var(--primary-light); font-weight: 600; font-size: 0.85rem; }

.navbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.cart-icon { position: relative; }
.cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--accent);
    color: var(--primary-dark);
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-dropdown { position: relative; }
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    padding-top: 10px;
    background: transparent;
    display: none;
    z-index: 100;
}
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: 10px; left: 0; right: 0; bottom: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}
.navbar-dropdown:hover .dropdown-menu,
.navbar-dropdown.open .dropdown-menu { display: block; animation: dropdownFadeIn 0.15s ease; }
@keyframes dropdownFadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.dropdown-header { position: relative; padding: 12px 16px; font-weight: 600; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.dropdown-item {
    position: relative;
    display: block;
    padding: 10px 16px;
    color: var(--text);
    font-size: 0.9rem;
    transition: background var(--transition);
}
.dropdown-item:hover { background: var(--bg-alt); color: var(--text); }
.dropdown-divider { position: relative; height: 1px; background: var(--border); }

.navbar-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.navbar-toggle span { display: block; width: 22px; height: 2px; background: var(--text); transition: all var(--transition); border-radius: 2px; }

.mobile-menu {
    display: none;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}
.mobile-menu.active { display: block; }
.mobile-menu a {
    display: block;
    padding: 12px 0;
    color: var(--text);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}
.mobile-search input {
    width: 100%;
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    background: var(--bg-alt);
    color: var(--text);
}

/* ---- Hero ---- */
.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    padding: 80px 0;
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,215,0,0.15) 0%, transparent 70%);
    border-radius: 50%;
}
.hero h1 {
    font-size: 3rem;
    color: #fff;
    margin-bottom: 16px;
    position: relative;
}
.hero h1 span { color: var(--accent); }
.hero p { font-size: 1.2rem; opacity: 0.9; max-width: 600px; margin: 0 auto 32px; position: relative; }
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 48px;
    position: relative;
}
.hero-stat-number { font-size: 2.5rem; font-weight: 800; color: var(--accent); }
.hero-stat-label { font-size: 0.9rem; opacity: 0.8; }

/* ---- Filters ---- */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}
.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-group label { font-weight: 500; font-size: 0.9rem; color: var(--text-muted); white-space: nowrap; }
.filter-group select,
.filter-group input[type="number"] {
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    transition: border-color var(--transition);
}
.filter-group select:focus,
.filter-group input:focus { outline: none; border-color: var(--primary-light); }
.filter-group input[type="number"] { width: 100px; }
.filters-bar .btn { margin-left: auto; }

/* ---- Product Grid ---- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
    position: relative;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product-card { cursor: pointer; }

.product-card-image {
    position: relative;
    padding-top: 65%;
    overflow: hidden;
    background: var(--bg-alt);
}
.product-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.product-card:hover .product-card-image img { transform: scale(1.05); }

.product-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--accent);
    color: var(--primary-dark);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 50px;
    text-transform: uppercase;
}

.product-card-like {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    color: var(--text-muted);
}
.product-card-like:hover,
.product-card-like.liked { color: var(--danger); background: #fff; }
.product-card-like.liked svg { fill: var(--danger); }

.product-card-body { padding: 16px; }
.product-card-category {
    font-size: 0.8rem;
    color: var(--primary-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.product-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card-name a { color: var(--text); }
.product-card-name a:hover { color: var(--primary-light); }

.product-card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.product-card-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}
[data-theme="dark"] .product-card-price { color: var(--accent); }
.product-card-price small { font-size: 0.75rem; font-weight: 400; color: var(--text-muted); }

.product-card-footer .btn { padding: 8px 16px; font-size: 0.85rem; }

/* ---- Stars ---- */
.icon-star { display: inline-block; width: 16px; height: 16px; position: relative; }
.icon-star::before {
    content: '\2605';
    font-size: 16px;
    color: var(--text-light);
}
.icon-star.filled::before { color: var(--accent); }
.icon-star.half::before { color: var(--accent); }

/* ---- Product Detail ---- */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    padding: 40px 0;
}
.product-gallery {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-alt);
}
.product-gallery img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}
.product-gallery-thumbs {
    display: flex;
    gap: 8px;
    padding: 12px;
}
.product-gallery-thumbs img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-xs);
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color var(--transition);
}
.product-gallery-thumbs img.active,
.product-gallery-thumbs img:hover { border-color: var(--primary-light); }

.product-info .breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--primary-light); }
.breadcrumbs span { color: var(--text-light); }

.product-info h1 { font-size: 2rem; margin-bottom: 8px; }
.product-info .product-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
}
[data-theme="dark"] .product-info .product-price { color: var(--accent); }
.product-info .product-price small { font-size: 1rem; font-weight: 400; color: var(--text-muted); }
.product-info .product-stock {
    font-size: 0.9rem;
    margin-bottom: 24px;
}
.stock-available { color: var(--success); font-weight: 500; }
.stock-low { color: var(--warning); font-weight: 500; }
.stock-out { color: var(--danger); font-weight: 500; }

.product-description { margin-bottom: 24px; }
.product-description h3 { font-size: 1.1rem; margin-bottom: 12px; }
.product-description ul {
    list-style: disc;
    padding-left: 20px;
}
.product-description ul li {
    margin-bottom: 6px;
    color: var(--text);
    line-height: 1.5;
}

.product-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
.quantity-input {
    display: flex;
    align-items: center;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.quantity-input button {
    width: 40px;
    height: 44px;
    border: none;
    background: var(--bg-alt);
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    transition: background var(--transition);
}
.quantity-input button:hover { background: var(--border); }
.quantity-input input {
    width: 60px;
    height: 44px;
    text-align: center;
    border: none;
    border-left: 2px solid var(--border);
    border-right: 2px solid var(--border);
    font-weight: 600;
    font-size: 1rem;
    background: var(--bg);
    color: var(--text);
}
.quantity-input input:focus { outline: none; }

.product-like-btn {
    width: 44px;
    height: 44px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    color: var(--text-muted);
}
.product-like-btn:hover,
.product-like-btn.liked { border-color: var(--danger); color: var(--danger); }
.product-like-btn.liked svg { fill: var(--danger); }

/* ---- Comments ---- */
.comments-section { padding: 40px 0; }
.comment-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 16px;
}
.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.comment-author { font-weight: 600; }
.comment-date { font-size: 0.8rem; color: var(--text-muted); }
.comment-rating { margin-bottom: 8px; }
.comment-content { color: var(--text); line-height: 1.6; }

.comment-form {
    background: var(--bg-alt);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 24px;
}
.comment-form h3 { margin-bottom: 16px; }

.star-rating-input {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    direction: rtl;
    justify-content: flex-end;
}
.star-rating-input input { display: none; }
.star-rating-input label {
    font-size: 28px;
    color: var(--text-light);
    cursor: pointer;
    transition: color var(--transition);
}
.star-rating-input label:hover,
.star-rating-input label:hover ~ label,
.star-rating-input input:checked ~ label {
    color: var(--accent);
}

/* ---- Cart ---- */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}
.cart-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.cart-product {
    display: flex;
    align-items: center;
    gap: 16px;
}
.cart-product img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}
.cart-product-name { font-weight: 600; }
.cart-product-cat { font-size: 0.8rem; color: var(--text-muted); }
.cart-remove {
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    transition: color var(--transition);
}
.cart-remove:hover { color: var(--danger); }

.cart-summary {
    background: var(--bg-alt);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 24px;
}
.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}
.cart-summary-total {
    font-size: 1.3rem;
    font-weight: 700;
    border-top: 2px solid var(--border);
    padding-top: 12px;
    margin-top: 8px;
}

/* ---- Forms ---- */
.form-container {
    max-width: 560px;
    margin: 0 auto;
    padding: 40px 0;
}
.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
}
.form-card h1 { font-size: 1.8rem; margin-bottom: 8px; text-align: center; }
.form-card .form-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 32px; }

.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 0.9rem;
}
.form-group label .required { color: var(--danger); }
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 0.95rem;
    transition: all var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(76,175,80,0.15);
}
.form-control.error { border-color: var(--danger); }
.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 0.8rem; color: var(--danger); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-privacy { font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; font-style: italic; }
.form-link { text-align: center; margin-top: 20px; font-size: 0.9rem; }

textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }

/* ---- Alerts ---- */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin: 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    border: 1px solid transparent;
}
.alert-success { background: #D4EDDA; color: #155724; border-color: #C3E6CB; }
.alert-warning { background: #FFF3CD; color: #856404; border-color: #FFEEBA; }
.alert-danger { background: #F8D7DA; color: #721C24; border-color: #F5C6CB; }
.alert-info { background: #D1ECF1; color: #0C5460; border-color: #BEE5EB; }
.alert-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    line-height: 1;
}
.alert-close:hover { opacity: 1; }

/* ---- Badges ---- */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-success { background: #D4EDDA; color: #155724; }
.badge-warning { background: #FFF3CD; color: #856404; }
.badge-danger { background: #F8D7DA; color: #721C24; }
.badge-info { background: #D1ECF1; color: #0C5460; }
.badge-primary { background: #E8F5E9; color: var(--primary); }
.badge-accent { background: var(--accent-light); color: #7B6800; }

/* ---- Profile ---- */
.profile-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    padding: 40px 0;
}
.profile-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: calc(var(--navbar-height) + 20px);
}
.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-light);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto 16px;
}
.profile-name { text-align: center; font-weight: 600; font-size: 1.1rem; margin-bottom: 4px; }
.profile-email { text-align: center; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 24px; }
.profile-nav a {
    display: block;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
    margin-bottom: 4px;
    transition: all var(--transition);
}
.profile-nav a:hover,
.profile-nav a.active { background: var(--bg-alt); color: var(--primary-light); }

.profile-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}
.profile-section { margin-bottom: 32px; }
.profile-section:last-child { margin-bottom: 0; }
.profile-section h2 { font-size: 1.3rem; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

/* ---- Order History ---- */
.order-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    overflow: hidden;
}
.order-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-alt);
    flex-wrap: wrap;
    gap: 12px;
}
.order-card-header .order-id { font-weight: 600; }
.order-card-header .order-date { font-size: 0.85rem; color: var(--text-muted); }
.order-card-body { padding: 16px 20px; }
.order-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.9rem;
}
.order-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-alt);
}
.order-total { font-weight: 700; font-size: 1.1rem; }

/* ---- Checkout ---- */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 32px;
    padding: 40px 0;
}
.checkout-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
}
.checkout-section h2 { font-size: 1.3rem; margin-bottom: 20px; }

.address-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    cursor: pointer;
    transition: all var(--transition);
}
.address-option:hover { border-color: var(--primary-light); }
.address-option.selected { border-color: var(--primary-light); background: rgba(76,175,80,0.05); }
.address-option input[type="radio"] { margin-top: 3px; accent-color: var(--primary-light); }

.checkout-recap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    position: sticky;
    top: calc(var(--navbar-height) + 20px);
}
.checkout-recap h3 { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.checkout-recap-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.9rem;
}
.checkout-recap-total {
    display: flex;
    justify-content: space-between;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 2px solid var(--border);
    font-size: 1.2rem;
    font-weight: 700;
}

/* ---- Order Confirm (Thank You) ---- */
.confirm-page {
    text-align: center;
    padding: 60px 0;
    max-width: 600px;
    margin: 0 auto;
}
.confirm-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto 24px;
    animation: scaleIn 0.5s ease;
}
@keyframes scaleIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}
.confirm-page h1 { font-size: 2.5rem; color: var(--primary); margin-bottom: 16px; }
[data-theme="dark"] .confirm-page h1 { color: var(--accent); }
.confirm-page p { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 32px; }

.confirm-order-details {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: left;
    margin-bottom: 32px;
}
.confirm-order-details h3 { margin-bottom: 16px; text-align: center; }

.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: #25D366;
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1.1rem;
    transition: all var(--transition);
    text-decoration: none;
}
.whatsapp-btn:hover { background: #1EBE57; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(37,211,102,0.4); }

/* ---- Favorites ---- */
.favorites-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }

/* ---- Pagination ---- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 0;
}
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    color: var(--text);
    transition: all var(--transition);
}
.pagination a:hover { background: var(--bg-alt); border-color: var(--primary-light); color: var(--primary-light); }
.pagination .active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ---- Toast ---- */
#toast-container {
    position: fixed;
    top: calc(var(--navbar-height) + 16px);
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
    min-width: 280px;
    max-width: 400px;
    font-size: 0.9rem;
}
.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-error { border-left: 4px solid var(--danger); }
.toast.toast-info { border-left: 4px solid var(--info); }
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* ---- Admin ---- */
.admin-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: calc(100vh - var(--navbar-height));
}
.admin-sidebar {
    background: var(--primary-dark);
    color: #fff;
    padding: 24px 0;
}
.admin-sidebar h3 {
    color: var(--accent);
    padding: 0 20px;
    margin-bottom: 24px;
    font-size: 1.1rem;
}
.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    transition: all var(--transition);
}
.admin-sidebar a:hover,
.admin-sidebar a.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.admin-content { padding: 32px; }
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}
.admin-header h1 { font-size: 1.8rem; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
}
.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
}
.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--bg-alt);
    color: var(--primary);
}
.stat-card.stat-primary .stat-icon { background: rgba(46, 125, 50, 0.1); color: #2e7d32; }
.stat-card.stat-warning .stat-icon { background: rgba(237, 108, 2, 0.1); color: #ed6c02; }
.stat-card.stat-success .stat-icon { background: rgba(46, 125, 50, 0.1); color: #2e7d32; }
.stat-card.stat-info .stat-icon { background: rgba(2, 136, 209, 0.1); color: #0288d1; }
.stat-card .stat-number { font-size: 1.8rem; font-weight: 800; color: var(--text); line-height: 1.2; }
.stat-card.stat-primary .stat-number { color: #2e7d32; }
.stat-card.stat-warning .stat-number { color: #ed6c02; }
.stat-card.stat-success .stat-number { color: #2e7d32; }
.stat-card.stat-info .stat-number { color: #0288d1; }
[data-theme="dark"] .stat-card .stat-number { color: var(--accent); }
.stat-card .stat-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }

/* ---- Admin Panels ---- */
.admin-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.admin-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.admin-panel-header h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}
.admin-panel .admin-table { border: none; border-radius: 0; }

/* ---- Top Products List ---- */
.top-products-list { padding: 8px 0; }
.top-product-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    transition: background var(--transition);
}
.top-product-item:hover { background: var(--bg-alt); }
.top-product-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}
.top-product-img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-xs);
    object-fit: cover;
    flex-shrink: 0;
}
.top-product-info { min-width: 0; }
.top-product-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.top-product-stats {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ---- Recent Users List ---- */
.recent-users-list { padding: 8px 0; }
.recent-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    transition: background var(--transition);
}
.recent-user-item:hover { background: var(--bg-alt); }
.recent-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ---- Admin Sidebar SVG alignment ---- */
.admin-sidebar a svg {
    flex-shrink: 0;
    opacity: 0.7;
}
.admin-sidebar a:hover svg,
.admin-sidebar a.active svg { opacity: 1; }

.admin-table { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.admin-table th {
    text-align: left;
    padding: 14px 16px;
    background: var(--bg-alt);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}
.admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 0.9rem; vertical-align: middle; }
.admin-table tr:hover { background: var(--bg-alt); }
.admin-table .actions { display: flex; gap: 8px; }
.admin-table .actions a,
.admin-table .actions button {
    padding: 6px 10px;
    border-radius: var(--radius-xs);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    text-decoration: none;
}
.admin-table .actions a:hover,
.admin-table .actions button:hover { background: var(--bg-alt); }
.admin-table .actions .btn-delete { color: var(--danger); border-color: var(--danger); }
.admin-table .actions .btn-delete:hover { background: var(--danger); color: #fff; }

.admin-form {
    max-width: 700px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}

/* ---- Footer ---- */
.footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.8);
    padding: 48px 0 24px;
    margin-top: auto;
    flex-shrink: 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}
.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: #fff;
}
.footer-col h4 { color: #fff; margin-bottom: 16px; font-size: 1rem; }
.footer-col a {
    display: block;
    color: rgba(255,255,255,0.6);
    padding: 4px 0;
    font-size: 0.9rem;
    transition: color var(--transition);
}
.footer-col a:hover { color: var(--accent); }
.footer-col p { font-size: 0.9rem; line-height: 1.8; }
.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
}
.footer-privacy { margin-top: 8px; font-style: italic; opacity: 0.6; }

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}
.empty-state svg { color: var(--text-light); margin-bottom: 16px; }
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); margin-bottom: 24px; }

/* ---- Responsive ---- */
@media (max-width: 992px) {
    .product-detail { grid-template-columns: 1fr; gap: 24px; }
    .checkout-layout { grid-template-columns: 1fr; }
    .profile-layout { grid-template-columns: 1fr; }
    .profile-sidebar { position: static; }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar {
        display: flex;
        overflow-x: auto;
        padding: 12px;
        gap: 4px;
    }
    .admin-sidebar h3 { display: none; }
    .admin-sidebar a { white-space: nowrap; padding: 8px 16px; border-radius: var(--radius-sm); }
    .admin-content > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    h1 { font-size: 1.8rem; }
    .hero { padding: 48px 0; }
    .hero h1 { font-size: 2rem; }
    .hero-stats { gap: 24px; flex-wrap: wrap; }
    .hero-stat-number { font-size: 1.8rem; }
    .navbar-search { display: none; }
    .navbar-toggle { display: flex; }
    .navbar-actions .btn { display: none; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
    .filters-bar { flex-direction: column; align-items: stretch; }
    .filter-group { flex-wrap: wrap; }
    .filters-bar .btn { margin-left: 0; }
    .form-card { padding: 24px; }
    .form-row { grid-template-columns: 1fr; }
    .cart-table { font-size: 0.85rem; }
    .footer-grid { grid-template-columns: 1fr; }
    .product-actions { flex-wrap: wrap; }
    .checkout-recap { position: static; }
}

@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .product-grid { grid-template-columns: 1fr; }
    .cart-product img { width: 50px; height: 50px; }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--text-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---- Selection ---- */
::selection { background: var(--primary-light); color: #fff; }

/* ---- Loading spinner ---- */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--primary-light);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Language Selector ---- */
.lang-selector {
    position: relative;
}
.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.lang-btn:hover { border-color: var(--primary-light); }
.lang-btn .lang-flag { font-size: 1.1rem; line-height: 1; }
.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    padding-top: 6px;
    background: transparent;
    display: none;
    z-index: 100;
    min-width: 160px;
}
.lang-dropdown::before {
    content: '';
    position: absolute;
    top: 6px; left: 0; right: 0; bottom: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}
.lang-selector:hover .lang-dropdown,
.lang-selector.open .lang-dropdown { display: block; animation: dropdownFadeIn 0.15s ease; }
.lang-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}
.lang-option:hover { background: var(--bg-alt); }
.lang-option.active { background: var(--bg-alt); font-weight: 600; }
.lang-option .lang-flag { font-size: 1.2rem; }

/* ---- Price on Request ---- */
.product-price-request {
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--accent-light), var(--bg-alt));
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    margin: 12px 0;
}
.price-request-label {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
    margin-bottom: 6px;
}
.price-request-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}
.product-photo-notice {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 10px;
    line-height: 1.5;
}
.product-card-price.price-on-request {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}
.search-item-cat {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ---- Invoice Print ---- */
@media print {
    .no-print { display: none !important; }
    body { background: #fff !important; color: #000 !important; }
    .invoice-container { box-shadow: none !important; border: none !important; max-width: 100% !important; }
}
