body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-color: #f4f4f4;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
* { box-sizing: border-box; }

/* Header & Nav */
header {
    background-color: #007dc6;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}
h1 { margin: 0; font-size: 1.5rem; }

/* Breadcrumbs */
#breadcrumb-container {
    background: white;
    padding: 10px 2rem;
    font-size: 0.9rem;
    border-bottom: 1px solid #ddd;
}
.crumb-link { color: #007dc6; cursor: pointer; text-decoration: underline; }

/* Layout Grid */
.container {
    display: flex;
    max-width: 1200px;
    width: 100%;
    margin: 20px auto;
    padding: 0 1rem;
    gap: 20px;
}

/* Sidebar Nav */
nav.sidebar {
    width: 200px;
    flex-shrink: 0;
    background: white;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    height: fit-content;
}
nav.sidebar ul { list-style: none; padding: 0; margin: 0; }
nav.sidebar li {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}
nav.sidebar li:hover { background-color: #f0f8ff; color: #007dc6; font-weight: bold; }

main { flex-grow: 1; }

/* PRODUCT GRID */
.product-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.product-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    width: calc(33.333% - 10px);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s;
}
.product-card:hover { box-shadow: 0 10px 16px rgba(0,0,0,0.1); }

@media (max-width: 768px) {
    .product-card { width: calc(50% - 10px); }
    .container { flex-direction: column; }
    nav.sidebar { width: 100%; margin-bottom: 10px; }
}

.thumb-placeholder {
    width: 200px;
    height: 200px;
    background-color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    cursor: pointer;
    margin-bottom: 10px;
}
.product-card h3 { margin: 5px 0; font-size: 1rem; cursor: pointer; color: #333; }
.product-card .price { color: #b12704; font-weight: bold; font-size: 1.1rem; margin: 5px 0; }

.add-btn {
    background-color: #ffc220;
    border: 1px solid #e56b00;
    padding: 8px;
    cursor: pointer;
    border-radius: 3px;
    margin-top: auto;
    transition: background-color 0.7s ease;
}
.add-btn:hover { background-color: #ff8c00; }

/* SHOPPING LIST */
.cart-widget {
    position: relative;
    padding: 10px;
    background: #005f96;
    border-radius: 4px;
    cursor: pointer;
}
.cart-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 300px;
    background: white;
    color: black;
    border: 1px solid #ccc;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    padding: 15px;
}
.cart-widget:hover .cart-dropdown { display: block; }
.cart-widget.open .cart-dropdown { display: block; }
.cart-dropdown ul { list-style: none; padding: 0; max-height: 200px; overflow-y: auto; padding-right: 20px; }
.cart-dropdown li {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}
.cart-dropdown input { width: 40px; padding: 3px; }
.checkout-btn {
    width: 100%;
    background-color: #333;
    color: white;
    border: none;
    padding: 10px;
    margin-top: 10px;
    cursor: pointer;
}

/* Product Detail View */
.product-detail {
    background: white;
    padding: 20px;
    display: flex;
    gap: 30px;
}
.detail-image-placeholder {
    width: 400px;
    height: 400px;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.detail-image-wrapper { width: 400px; flex-shrink: 0; }
.product-swiper {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 4px;
    overflow: hidden;
    background: #eee;
}
.product-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}
.product-swiper .product-full-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.detail-info h1 { margin-top: 0; }
.add-btn.large { font-size: 0.9rem; padding: 10px 30px; }

/* Footer */
.main-footer {
    margin-top: auto;
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.8rem;
    background: #423030;
}
.footer-container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* Header/Logo Links */
.logo-link { color: white; text-decoration: none; }
.product-link { text-decoration: none; color: inherit; }

/* Cart & Pricing */
.cart-total-row { text-align: right; font-weight: bold; margin: 10px 0; }
.cart-item-row { display: flex; align-items: center; width: 100%; gap: 8px; }
.cart-qty-input { width: 50px; padding: 3px; margin: 0 5px; border: 1px solid #ccc; border-radius: 3px; }
.cart-item-row span:first-child { flex: 1; }
.cart-item-row span:last-child { min-width: 70px; text-align: right; }
.full-width-main { width: 100%; }
.qty-input { width: 50px; padding: 5px; }

/* Image wrapper */
.image-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    margin-bottom: 10px;
}
.product-thumb {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.25s ease;
}
.product-card:hover .product-thumb { transform: scale(1.08); }

/* Cart alert */
.cart-alert-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: cart-alert-fade-in 0.2s ease;
}
.cart-alert-overlay.cart-alert-closing { animation: cart-alert-fade-out 0.2s ease forwards; }
@keyframes cart-alert-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cart-alert-fade-out { from { opacity: 1; } to { opacity: 0; } }
.cart-alert-box {
    min-width: 280px;
    max-width: 90vw;
    padding: 1.5rem 1.75rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    text-align: center;
    animation: cart-alert-scale-in 0.25s ease;
}
@keyframes cart-alert-scale-in { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.cart-alert-icon { width: 64px; height: 64px; display: block; margin: 0 auto 1rem; object-fit: contain; }
.cart-alert-message { margin: 0 0 1.25rem; font-size: 1rem; line-height: 1.4; color: #333; }
.cart-alert-box.cart-alert-success { background: linear-gradient(180deg, #e8f5e9 0%, #c8e6c9 100%); border: 1px solid #a5d6a7; }
.cart-alert-box.cart-alert-success .cart-alert-message { color: #2e7d32; }
.cart-alert-box.cart-alert-warning { background: linear-gradient(180deg, #fff8e1 0%, #ffecb3 100%); border: 1px solid #ffe082; }
.cart-alert-box.cart-alert-warning .cart-alert-message { color: #e65100; }
.cart-alert-btn { background: #007dc6; color: white; border: none; padding: 0.5rem 1.5rem; border-radius: 6px; font-size: 1rem; cursor: pointer; transition: background-color 0.2s ease; }
.cart-alert-btn:hover { background: #005f96; }

/* Header controls */
.header-controls { display: flex; align-items: center; gap: 15px; }
.login-link { display: flex; align-items: center; cursor: pointer; text-decoration: none; }
.login-icon { width: 28px; height: 28px; object-fit: contain; transition: transform 0.2s; }
.login-icon:hover { transform: scale(1.1); }

/* User display in header */
.user-display { color: white; font-size: 0.9rem; white-space: nowrap; }

/* ADMIN PANEL STYLES */
.admin-header-controls { display: flex; gap: 15px; align-items: center; }
.store-link { color: white; text-decoration: none; }
.store-link:hover { text-decoration: underline; }
.btn-logout { padding: 5px 10px; font-size: 0.9rem; background-color: #dc3545; color: white; border: none; border-radius: 4px; cursor: pointer; }
.btn-logout:hover { background-color: #c82333; }
.admin-container { max-width: 1000px; margin: 20px auto; padding: 20px; width: 100%; }
.admin-section { background: white; padding: 20px; margin-bottom: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

/* Form Styles */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px; font-family: inherit; }
.form-group textarea { min-height: 100px; resize: vertical; }
.form-group small { display: block; margin-top: 5px; color: #666; font-size: 0.85em; }

/* Buttons */
.btn { padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; font-family: inherit; display: inline-block; }
.btn-primary { background-color: #007dc6; color: white; }
.btn-primary:hover { background-color: #005f96; }
.btn-secondary { background-color: #6c757d; color: white; }
.btn-secondary:hover { background-color: #5a6268; }
.btn-danger { background-color: #dc3545; color: white; }
.btn-danger:hover { background-color: #c82333; }
.btn-edit { background-color: #ffc107; color: #212529; }
.btn-edit:hover { background-color: #e0a800; }

/* List Styles */
.product-list, .category-list { margin-top: 20px; }
.list-item { padding: 10px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.list-item:hover { background-color: #f8f9fa; }
.list-item-controls { display: flex; gap: 10px; }

/* LOGIN PAGE */
.login-container { max-width: 450px; margin: 60px auto; padding: 30px; background: white; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.login-container .form-group { text-align: left; }
.error-msg { color: #dc3545; margin-bottom: 15px; background-color: #f8d7da; border: 1px solid #f5c6cb; padding: 10px; border-radius: 4px; }
.success-msg { color: #155724; margin-bottom: 15px; background-color: #d4edda; border: 1px solid #c3e6cb; padding: 10px; border-radius: 4px; }
.full-width-btn { width: 100%; }

/* Auth Tabs */
.auth-tabs { display: flex; margin-bottom: 20px; border-bottom: 2px solid #ddd; }
.auth-tab { flex: 1; padding: 10px; border: none; background: none; cursor: pointer; font-size: 1rem; font-family: inherit; color: #666; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.auth-tab.active { color: #007dc6; border-bottom-color: #007dc6; font-weight: bold; }
.auth-tab:hover { color: #007dc6; }

/* Swiper Navigation Arrows */
.swiper-button-next,
.swiper-button-prev {
    color: #007dc6;
    font-size: 32px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.swiper-button-next::after {
    content: '>' !important;
}

.swiper-button-prev::after {
    content: '<' !important;
}

/* Swiper Pagination Dots */
.swiper-pagination-bullet {
    background: #007dc6;
}

.swiper-pagination-bullet-active {
    background: #005f96;
}

/* Admin Image Previews */
.admin-image-preview { margin-bottom: 10px; }
.admin-gallery-preview { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.admin-img-wrapper { position: relative; display: inline-block; }
.admin-img-thumb { height: 100px; border: 1px solid #ddd; border-radius: 4px; }
.admin-img-label { margin: 0; font-size: 0.8rem; color: #666; }
.admin-btn-remove { position: absolute; top: -8px; right: -8px; background: #dc3545; color: white; border: none; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.admin-msg-error { color: #dc3545; font-style: italic; }
.admin-msg-empty { color: #999; font-style: italic; }
.admin-gallery-thumb { width: 80px; height: 80px; object-fit: cover; border: 1px solid #ddd; border-radius: 4px; }
.admin-btn-remove-gallery { position: absolute; top: -5px; right: -5px; background: #dc3545; color: white; border: none; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* Utility Classes */
.hidden {
    display: none !important;
}
