/* Base Styles and Modern Reset */
:root {
    --primary: #ce1c22;
    /* Red inspired by ExtraBom/Supermarkets */
    --secondary: #004899;
    /* Blue inspired by ExtraBom */
    --accent: #ffc107;
    /* Yellow for highlights */
    --text: #333333;
    --text-muted: #777777;
    --bg-light: #f4f6f8;
    --white: #ffffff;
    --border: #e0e0e0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --container-width: 1320px;
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    background-color: var(--bg-light);
    color: var(--text);
    line-height: 1.5;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
}

/* --- HEADER --- */
header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Header Row 1 */
.header-top {
    padding: 15px 0;
}

.header-top .container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 30px;
}

.logo img {
    height: 50px;
    display: block;
}

.logo h1 {
    font-size: 1.8rem;
    color: var(--primary);
    font-weight: 800;
}

.search-bar form {
    display: flex;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid var(--primary);
    border-radius: 4px;
    font-size: 1rem;
    outline: none;
}

.search-bar button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    background: var(--primary);
    border: none;
    color: white;
    padding: 0 20px;
    cursor: pointer;
    font-size: 1.2rem;
    border-radius: 0 2px 2px 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 25px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.icon-link {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.icon-wrapper {
    font-size: 1.8rem;
    position: relative;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
}

/* Header Row 2 */
.header-bottom {
    background: var(--secondary);
    color: white;
}

.categories-nav ul {
    list-style: none;
    display: flex;
    gap: 2px;
}

.categories-nav a {
    display: block;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.categories-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* --- HERO BANNER --- */
.hero-wrapper {
    width: 100%;
    margin-bottom: 40px;
}

.hero-banner {
    width: 100%;
    height: 320px;
    overflow: hidden;
    position: relative;
}

.hero-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- VITRINES --- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-top: 20px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
    text-transform: uppercase;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 4px;
    background: var(--primary);
    margin-top: 5px;
}

.view-all {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.vitrine {
    margin-bottom: 50px;
}

/* --- PRODUCT GRID --- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* --- PRODUCT CARD --- */
.product-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 15px;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    box-shadow: var(--shadow);
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary);
    color: white;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
    z-index: 1;
}

.product-img-wrapper {
    aspect-ratio: 1/1;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

.product-img-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 10px;
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
}

.product-price-block {
    margin-bottom: 15px;
    min-height: 50px;
}

.price-old {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.price-main {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--secondary);
}

.price-prefix {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-right: 2px;
}

.btn-buy {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    text-transform: uppercase;
}

.btn-buy:hover {
    filter: brightness(0.9);
}

/* --- CATEGORIES MINI BLOCK --- */
.categories-mini {
    background: white;
    padding: 30px 0;
    margin: 40px 0;
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
}

.categories-mini-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.category-mini-item {
    text-align: center;
    width: 120px;
}

.category-mini-icon {
    width: 60px;
    height: 60px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 1.5rem;
}

.category-mini-name {
    font-size: 0.85rem;
    font-weight: 600;
}

/* --- HOW IT WORKS SECTION --- */
.info-section {
    padding: 50px 0;
    background: white;
    margin-bottom: 50px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.info-card {
    text-align: center;
}

.info-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.info-title {
    font-weight: 700;
    margin-bottom: 10px;
}

.info-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* --- FOOTER --- */
footer {
    background: var(--secondary);
    color: white;
    padding: 60px 0 20px;
}

.footer-main {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 50px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: var(--accent);
    margin-bottom: 20px;
    text-transform: uppercase;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.footer-col a:hover {
    color: var(--accent);
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-icon {
    font-size: 1.5rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

/* --- CATALOG PAGES --- */
.catalog-layout {
    margin-top: 30px;
}

.breadcrumbs {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.filter-bar {
    background: white;
    padding: 15px 20px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-bar select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
}

/* --- PRODUCT PAGE (PDP) --- */
.product-pdp {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-top: 40px;
}

.pdp-gallery {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
}

.pdp-gallery img {
    width: 100%;
    object-fit: contain;
}

.pdp-info h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--secondary);
}

.pdp-code {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.pdp-price-box {
    background: #f8f9fa;
    padding: 25px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
}

.pdp-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-large {
    padding: 18px;
    font-size: 1.2rem;
}

.btn-outline {
    border: 2px solid var(--secondary);
    color: var(--secondary);
    background: transparent;
    font-weight: 700;
    padding: 12px;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-main {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .header-top .container {
        grid-template-columns: 1fr auto;
    }

    .search-bar {
        grid-column: 1 / -1;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-banner {
        height: 180px;
    }

    .product-pdp {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .categories-nav ul {
        overflow-x: auto;
    }
}