:root {
    --primary: #ffffff;
    --primary-hover: #7298ca;
    --primary-light: #fdf2f8;
    --accent: #d81b60;
    --bg-main: #ffffff;
    --bg-card: #ffffff;
    --text-main: #1a1a1a;
    --text-muted: #666666;
    --border: #f0f0f0;
    --pink-border: #e91e63;
    --pink-bg: #3b73a0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 30px;
}

/* Header & Logo */
.main-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
}

.main-header .container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    height: 60px;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #000000;
    line-height: 1.2;
}

.brand-name span {
    display: block;
    font-size: 0.8rem;
    color: #444444;
    /* Dark gray for subtext */
    font-weight: 400;
    letter-spacing: 2px;
}

.header-center {
    text-align: center;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #0056ff, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.nav-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    align-items: center;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: #f1f5f9;
    color: var(--primary-hover);
    transform: rotate(45deg);
}

/* Cart Button */
.cart-btn {
    background: var(--primary);
    color: rgb(122, 59, 59);
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    position: relative;
}

.cart-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.filter-btn {
    padding: 6px 16px;
    border-radius: 50px;
    border: none;
    background: #0056ff;
    /* Vibrant Blue from Image */
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 86, 255, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.filter-btn:hover {
    background: #0044cc;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 86, 255, 0.4);
}

.shop-layout {
    display: flex;
    gap: 40px;
    margin-top: 30px;
    align-items: flex-start;
}

.catalog-section {
    flex: 1;
    min-width: 0;
}

.category-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 90px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.category-group {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.category-header {
    width: 100%;
    padding: 15px 20px;
    background: #0056ff;
    color: white;
    border: none;
    text-align: left;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-header:hover {
    background: #0044cc;
}

.category-header .chevron {
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.category-group.active .chevron {
    transform: rotate(180deg);
}

.category-content {
    display: none;
    flex-direction: column;
    background: white;
    border: 1px solid #e2e8f0;
    border-top: none;
}

.category-group.active .category-content {
    display: flex;
}

.category-content a {
    padding: 12px 25px;
    text-decoration: none;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s;
}

.category-content a:last-child {
    border-bottom: none;
}

.category-content a:hover {
    background: #f8fafc;
    color: #0056ff;
    padding-left: 30px;
}

.filter-btn.active {
    background: #0033aa;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

#cart-count {
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -5px;
    right: -5px;
}

/* Hero Carousel */
.hero-carousel {
    margin-top: 20px;
    border-radius: 16px;
    overflow: hidden;
    background: #f1f5f9;
}

.carousel-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 3.6;
    min-height: 180px;
}

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 30px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
}

.slide-content h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.slide-content p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
}

.carousel-control:hover {
    background: rgba(255, 255, 255, 0.4);
}

.carousel-control.prev {
    left: 20px;
}

.carousel-control.next {
    right: 20px;
}

.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s;
}

.dot.active {
    background: white;
    width: 24px;
    border-radius: 4px;
}

/* Catalog Grid */
.product-section {
    display: flex;
    border-top: 2px solid var(--primary);
    margin-bottom: 40px;
    background: white;
}

.product-sidebar {
    width: 250px;
    padding: 20px;
    border-right: 1px solid var(--pink-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.brand-logo-small {
    width: 120px;
    margin-bottom: 15px;
}

.brand-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
}

.product-main {
    flex: 1;
}

.product-table {
    width: 100%;
    border-collapse: collapse;
}

.product-table th {
    background: var(--pink-bg);
    color: var(--primary);
    text-align: left;
    padding: 12px 15px;
    font-weight: 600;
    font-size: 0.9rem;
}

.product-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95rem;
    vertical-align: middle;
}

.product-code {
    font-weight: 600;
    color: #333;
}

.product-image-cell {
    width: 150px;
    text-align: center;
}

.product-preview-img {
    width: 100px;
    height: auto;
    object-fit: contain;
}

.buy-btn-small {
    background: var(--primary);
    color: rgb(126, 50, 50);
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}

.buy-btn-small:hover {
    background: var(--primary-hover);
}

/* Product Card */

/* ── Nivel 1: Línea de producto ─────────────────────────── */
.line-header-row {
    background: #0056ff;
}

.line-header {
    padding: 10px 15px !important;
    border-bottom: none !important;
}

.line-label {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #ffffff;
}

.line-spacer-row td {
    padding: 6px 0 !important;
    background: #f8fafc;
    border-bottom: none !important;
}

/* ── Nivel 2: Presentación (subline) ────────────────────── */
.subline-header-row {
    background: #e8eeff;
}

.subline-header {
    padding: 7px 15px 7px 28px !important;
    border-bottom: none !important;
}

.subline-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #0044cc;
}

.subline-label::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 12px;
    background: #0056ff;
    border-radius: 2px;
}

/* Legacy Card styles removed in favor of tables */


/* Cart Drawer */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    z-index: 1000;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    transition: right 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
}

.cart-drawer.open {
    right: 0;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header-btns {
    display: flex;
    align-items: center;
    gap: 15px;
}

.clear-cart-btn {
    background: none;
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-cart-btn:hover {
    background: #ef4444;
    color: white;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h5 {
    margin-bottom: 5px;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.quantity-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
}

.total-container {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.checkout-btn {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #0056ff, #0033aa);
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 86, 255, 0.2);
}

.checkout-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 86, 255, 0.3);
    background: linear-gradient(135deg, #0066ff, #0044cc);
}

.checkout-btn:active:not(:disabled) {
    transform: translateY(0);
}

.checkout-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    align-items: center;
    justify-content: center;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    margin-bottom: 20px;
}

.order-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 0.95rem;
    background: #f8fafc;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #0056ff;
    background: white;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.remove-item {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
    align-self: flex-start;
}

.remove-item:hover {
    color: #ef4444;
}

.submit-order-btn {
    margin-top: 10px;
    padding: 15px;
    border-radius: var(--radius);
    border: none;
    background: #25d366;
    /* WhatsApp Green */
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-order-btn:hover {
    background: #128c7e;
}

@media (max-width: 768px) {
    .brand-name {
        font-size: 1.2rem;
    }

    .cart-drawer {
        width: 100%;
        right: -100%;
    }

    .hero-section h2 {
        font-size: 1.8rem;
    }
}