/* ===== VARIABLES CSS ===== */
:root {
    --primary-beige: #E8DCC8;
    --dark-grey: #2C3E50;
    --gold: #D4AF37;
    --dark-brown: #5A4A3A;
    --light-grey: #F5F3F0;
    --text-dark: #2C3E50;
    --text-light: #666666;
    --border-color: #D4C4B0;
    --hover-gold: #E6C200;
}

/* ===== RESET Y ESTILOS GLOBALES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-grey);
    color: var(--text-dark);
    line-height: 1.6;
}

/* ===== HEADER ===== */
.header {
    background: linear-gradient(135deg, var(--primary-beige) 0%, #F0EAE0 100%);
    border-bottom: 3px solid var(--gold);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo-section {
    flex: 0 0 150px;
}

.logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

/* ===== NAVEGACIÓN ===== */
.nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 40px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 16px;
    padding: 8px 16px;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

/* ===== CARRITO ICON ===== */
.cart-icon {
    flex: 0 0 50px;
    position: relative;
    font-size: 28px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.cart-icon:hover {
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--gold);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: calc(100vh - 200px);
}

.section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== INICIO ===== */
.home-panel {
    min-height: 520px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 50px 25px;
    background: linear-gradient(135deg, #F0EAE0 0%, #E8DCC8 100%);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(90, 74, 58, 0.12);
}

.home-logo {
    width: min(380px, 82vw);
    height: auto;
    margin-bottom: 25px;
    object-fit: contain;
    image-rendering: auto;
    filter: contrast(1.03) saturate(1.03);
}

.home-eyebrow {
    color: var(--gold);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.home-panel h1 {
    color: var(--text-dark);
    font-size: clamp(30px, 5vw, 48px);
    margin-bottom: 18px;
}

.home-description {
    max-width: 760px;
    color: var(--text-light);
    font-size: 17px;
    line-height: 1.8;
    margin-bottom: 30px;
}

.home-catalog-link {
    display: inline-block;
    background-color: var(--gold);
    color: white;
    border: 2px solid var(--gold);
    border-radius: 5px;
    padding: 13px 28px;
}

.home-catalog-link:hover {
    color: white;
    background-color: var(--hover-gold);
    border-bottom-color: var(--hover-gold);
}

/* ===== SECTION TITLE ===== */
.section-title {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 3px solid var(--gold);
    padding-bottom: 20px;
}

.section-title h1 {
    font-size: 36px;
    color: var(--text-dark);
    font-weight: 700;
    margin-bottom: 10px;
}

/* ===== FILTROS DE CATEGORÍA ===== */
.category-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid var(--gold);
    background-color: transparent;
    color: var(--gold);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 25px;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--gold);
    color: white;
}

/* ===== GRID DE PRODUCTOS ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.product-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
    border-color: var(--gold);
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background-color: var(--light-grey);
}

.product-image-wrapper {
    position: relative;
}

.product-placa-thumb {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.product-info {
    padding: 20px;
}

.product-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
    text-transform: capitalize;
}

.product-category {
    font-size: 12px;
    color: var(--gold);
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.product-price {
    font-size: 24px;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 15px;
}

.product-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-beige);
    color: var(--text-dark);
    border: 2px solid var(--gold);
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-btn:hover {
    background-color: var(--gold);
    color: white;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 32px;
    font-weight: bold;
    color: var(--text-dark);
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--gold);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.modal-images {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-image {
    position: relative;
    width: 100%;
    height: 190px;
    border-radius: 10px;
    overflow: hidden;
    background-color: var(--light-grey);
}

.image-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--gold);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 1;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}

/* ===== VISTA AMPLIADA AL PASAR EL MOUSE ===== */
.image-zoom-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 500;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    animation: fadeIn 0.2s ease;
}

.image-zoom-overlay.active {
    display: flex;
}

.image-zoom-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-details h2 {
    font-size: 28px;
    color: var(--text-dark);
    text-transform: capitalize;
}

.price-section,
.description-section,
.quantity-section,
.total-section {
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.price-label,
.total-label {
    font-weight: 600;
    color: var(--text-dark);
    display: block;
    margin-bottom: 5px;
}

.price-value,
.total-value {
    font-size: 28px;
    color: var(--gold);
    font-weight: 700;
}

.description-section h3 {
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.description-section p {
    color: var(--text-light);
    line-height: 1.8;
}

.measure-section {
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.measure-section h3 {
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.measure-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.measure-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

.measure-option.active {
    border-color: var(--gold);
    background-color: rgba(212, 175, 55, 0.08);
}

.measure-btn {
    flex: 1;
    border: 0;
    background: transparent;
    color: var(--text-dark);
    text-align: left;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.measure-quantity-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.measure-qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--gold);
    border-radius: 4px;
    background: white;
    color: var(--gold);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.measure-qty-btn:hover {
    background: var(--gold);
    color: white;
}

.measure-quantity {
    min-width: 20px;
    text-align: center;
    font-weight: 600;
}

.cart-measure {
    display: block;
    color: var(--text-light);
    font-size: 12px;
    margin-left: 45px;
}

.quantity-section label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--gold);
    background-color: white;
    color: var(--gold);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.qty-btn:hover {
    background-color: var(--gold);
    color: white;
}

#quantityInput {
    width: 60px;
    padding: 8px;
    border: 2px solid var(--gold);
    border-radius: 5px;
    font-size: 16px;
    text-align: center;
    font-weight: 600;
}

/* Ocultar flechas del input numérico */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* ===== BOTONES ===== */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background-color: var(--gold);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: var(--hover-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.btn-danger {
    background-color: #E74C3C;
    color: white;
    padding: 8px 12px;
    font-size: 14px;
}

.btn-danger:hover {
    background-color: #C0392B;
}

/* ===== COTIZACIÓN ===== */
.quote-container {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.quote-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.quote-table thead {
    background-color: var(--primary-beige);
}

.quote-table th {
    padding: 15px;
    text-align: left;
    font-weight: 700;
    color: var(--text-dark);
    border-bottom: 3px solid var(--gold);
}

.quote-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.quote-table tbody tr:hover {
    background-color: var(--light-grey);
}

.product-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 10px;
}

.quote-bottom {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.quote-notice {
    flex: 1;
    min-width: 250px;
    background-color: #FFF8E7;
    border-left: 4px solid var(--gold);
    border-radius: 8px;
    padding: 20px;
    color: var(--text-dark);
}

.quote-notice p {
    margin-bottom: 10px;
    line-height: 1.7;
}

.quote-notice p:last-child {
    font-weight: 600;
}

.whatsapp-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 10px 16px;
    border-radius: 5px;
    background-color: #25D366;
    color: white;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
}

.whatsapp-btn:hover {
    background-color: #1DA851;
}

.whatsapp-btn.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

.whatsapp-status {
    display: block;
    margin-top: 8px;
    color: var(--text-light);
    font-size: 12px;
}

.quote-summary {
    background-color: var(--primary-beige);
    padding: 20px;
    border-radius: 10px;
    margin-left: auto;
    width: 350px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--text-dark);
}

.summary-row.total {
    border-top: 2px solid var(--gold);
    padding-top: 12px;
    margin-top: 12px;
    font-size: 18px;
}

.summary-value {
    color: var(--gold);
    font-weight: 700;
}

.summary-row.total .summary-value {
    font-size: 22px;
}

#clearCartBtn {
    width: 100%;
    margin-top: 20px;
}

.empty-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-message p {
    font-size: 20px;
    margin-bottom: 20px;
}

.empty-message .nav-link {
    display: inline-block;
    background-color: var(--gold);
    color: white;
    padding: 12px 30px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.empty-message .nav-link:hover {
    background-color: var(--hover-gold);
    border-bottom-color: transparent;
}

/* ===== FOOTER ===== */
.footer {
    background: linear-gradient(135deg, var(--dark-grey) 0%, var(--dark-brown) 100%);
    color: white;
    padding: 40px 20px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 20px;
}

.footer-section h3 {
    color: var(--gold);
    margin-bottom: 15px;
    font-size: 16px;
    text-transform: uppercase;
}

.footer-section p {
    margin-bottom: 8px;
    color: #E0E0E0;
    line-height: 1.8;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    color: #B0B0B0;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        gap: 15px;
    }

    .logo-section {
        flex: 1 1 100%;
        text-align: center;
    }

    .nav {
        flex: 1 1 100%;
        order: 3;
    }

    .nav-list {
        justify-content: center;
        gap: 20px;
    }

    .cart-icon {
        flex: 0 0 auto;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }

    .modal-body {
        grid-template-columns: 1fr;
    }

    .modal-image {
        height: 220px;
    }

    .quote-summary {
        width: 100%;
        margin-left: 0;
        margin-top: 20px;
    }

    .section-title h1 {
        font-size: 28px;
    }

    .category-filters {
        gap: 10px;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 10px 15px;
    }

    .logo {
        height: 50px;
    }

    .nav-list {
        gap: 15px;
        font-size: 14px;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 20px 10px;
    }

    .quote-table {
        font-size: 14px;
    }

    .quote-table th,
    .quote-table td {
        padding: 10px;
    }

    .modal-content {
        padding: 20px;
        width: 95%;
    }

    .section-title h1 {
        font-size: 24px;
    }
}
