* {
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    margin: 0;
    color: var(--text);
    background-color: #f9f9f9;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.main-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header .container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

.logo img {
    max-height: 50px;
    width: auto;
}

.main-header nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark);
    cursor: pointer;
}

.main-header nav a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: color 0.3s;
}

.main-header nav a:visited {
    color: var(--text);
}

.main-header nav a:hover {
    color: var(--primary);
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    padding: 10px 0;
    z-index: 1001;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    display: block;
    padding: 10px 20px;
    color: var(--text);
}

.dropdown-content a:hover {
    background: #f9f9f9;
    color: var(--primary);
}

/* Search Bar */
.search-form {
    display: flex;
    align-items: center;
    background: #f1f3f5;
    border-radius: 8px;
    padding: 2px 10px;
    flex: 1;
    max-width: 600px;
    margin: 0 20px;
    border: 1px solid #dee2e6;
}

.user-tools {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-tool-item {
    color: var(--dark);
    text-decoration: none;
    font-size: 1.2rem;
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-tool-item span {
    font-size: 0.9rem;
    font-weight: 600;
}

.cart-count-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: #e63946;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border: 2px solid white;
}

.search-form input {
    border: none;
    background: transparent;
    outline: none;
    padding: 5px;
    font-family: inherit;
}

.search-form button {
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--dark);
    transition: color 0.3s;
}

.search-form button:hover {
    color: var(--primary);
}

/* Hero Slider */
.hero-slider {
    position: relative;
    height: 600px;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.slide.active {
    opacity: 1;
}

.slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay, rgba(0, 0, 0, 0.4));
}

.slide .content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
}

.slide h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.btn-hero {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    margin-top: 20px;
    transition: transform 0.3s;
}

.btn-hero:hover {
    transform: scale(1.05);
}

.slider-nav button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    padding: 1rem;
    cursor: pointer;
    z-index: 10;
}

.slider-nav .prev {
    left: 20px;
}

.slider-nav .next {
    right: 20px;
}

/* Products */
.products-section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--dark);
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.cat-tab {
    display: inline-block;
    padding: 10px 25px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 50px;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.cat-tab:hover,
.cat-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(230, 57, 70, 0.3);
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 1100px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}

/* Product Card */
.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    border: 1px solid #f0f0f0;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f8f8;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.04);
}

.product-info {
    padding: 12px;
    text-align: left;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-info h3 {
    margin: 0 0 6px;
    font-size: 0.88rem;
    color: #333;
    font-weight: 400;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.price {
    font-size: 1.15rem;
    color: #333;
    font-weight: 600;
    margin: 4px 0 0;
}

/* Hide old "Ver detalles" link — the whole card is now clickable */
.view-details-link {
    display: none;
}

.btn-buy {
    display: block;
    margin-top: 8px;
    padding: 7px 12px;
    background: var(--primary);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.82rem;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-buy:hover {
    background: #c1121f;
}


/* Contact Section */
.contact-section {
    padding: 4rem 0;
    background: #f9f9f9;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.contact-form-wrapper {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
}

.btn-submit {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-submit:hover {
    background: #d62828;
}

.map-wrapper {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.map-container {
    position: relative;
    padding-bottom: 75%;
    /* 4:3 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 5px;
}

.map-container iframe {
    position: absolute;
    top: 0;
    left: 0;
}

.gallery-thumbs img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.gallery-thumbs img:hover,
.gallery-thumbs img.active {
    opacity: 1;
    border: 2px solid var(--primary);
}

.info-column h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.price-large {
    font-size: 2rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 2rem;
}

.description {
    line-height: 1.6;
    color: #666;
    margin-bottom: 2rem;
}

.btn-buy-large {
    display: inline-block;
    padding: 15px 40px;
    background: #25D366;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 700;
    transition: transform 0.3s;
}

.btn-buy-large:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content-large {
    background: white;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 10px;
    position: relative;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    z-index: 10;
}

.modal-body {
    padding: 2rem;
}

.loading-spinner {
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: #666;
}

/* Modal Grid */
.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.modal-images {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-main-img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
}

.modal-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
}

.modal-thumbs img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.modal-thumbs img:hover,
.modal-thumbs img.active {
    opacity: 1;
    border: 2px solid var(--primary);
}

.modal-info h2 {
    margin-top: 0;
    font-size: 2rem;
    color: var(--dark);
}

.modal-price {
    font-size: 1.8rem;
    color: var(--primary);
    font-weight: 700;
    margin: 1rem 0;
}

.modal-desc {
    line-height: 1.6;
    color: #555;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .modal-grid {
        grid-template-columns: 1fr;
    }

    .modal-main-img {
        height: 300px;
    }
}

/* Footer */
footer {
    background: var(--dark);
    color: white;
    padding: 60px 0 30px;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 50px;
}

.footer-col h3,
.footer-col h4 {
    color: white;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 12px;
    font-size: 1.25rem;
}

.footer-col h3::after,
.footer-col h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background: var(--primary);
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-col ul li a:hover {
    color: var(--primary);
    padding-left: 5px;
}

.contact-info li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ccc;
}

.contact-info i {
    color: var(--primary);
    width: 20px;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
}

.btn-share {
    background: white;
    border: 1px solid #ddd;
    color: var(--dark);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-share:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Floating Cart Styles - Hidden as requested */
.cart-float {
    display: none !important;
}

.cart-float:hover {
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: red;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 50%;
}

/* Cart Modal/Sidebar */
.cart-modal {
    display: none;
    position: fixed;
    right: 0;
    top: 0;
    height: 100%;
    width: 350px;
    max-width: 100%;
    /* Ensure it fits mobile */
    background: white;
    z-index: 1001;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
    overflow-y: auto;
    font-family: 'Inter', sans-serif;
}

.cart-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.cart-total {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px dashed #eee;
    font-size: 1.2rem;
    font-weight: 700;
    text-align: right;
}

/* Global CP Bar */
.cp-bar {
    background: #0076CE;
    color: white;
    padding: 10px 0;
    font-size: 0.9rem;
    font-weight: 500;
}

.cp-bar .container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 15px;
}

.cp-selector-trigger {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s;
}

.cp-selector-trigger:hover {
    opacity: 0.8;
}

.cp-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2001;
    justify-content: center;
    align-items: center;
}

.cp-modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    color: var(--dark);
    text-align: center;
}

.cp-modal-content h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.cp-modal-content p {
    color: #666;
    margin-bottom: 20px;
}

.cp-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.cp-input-group input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.qty-control-pro {
    display: flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    width: fit-content;
    background: #f8fafc;
}

.qty-control-pro button {
    background: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1.2rem;
    color: #475569;
    transition: background 0.2s;
}

.qty-control-pro button:hover {
    background: #f1f5f9;
}

.qty-control-pro input {
    width: 50px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 1.1rem;
    color: #1e293b;
}

.btn-cp-confirm {
    background: #0076CE;
    color: white;
    box-shadow: 0 4px 10px rgba(0, 45, 76, 0.2);
}

.btn-add-pro {
    background: #0076CE;
    color: white;
    border: none;
    padding: 16px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 118, 206, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-add-pro:hover {
    background: #005fa3;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 118, 206, 0.4);
}

.specs-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 25px;
    margin-top: 40px;
}

.specs-table-pro {
    width: 100%;
    border-collapse: collapse;
}

.specs-table-pro tr td {
    padding: 12px 15px;
    border-bottom: 1px solid #f1f5f9;
}

.specs-table-pro tr td:first-child {
    font-weight: 600;
    color: #64748b;
    width: 30%;
}

.specs-table-pro tr:last-child td {
    border-bottom: none;
}

.floating-share {
    position: absolute;
    top: 20px;
    right: 20px;
}

@media (max-width: 900px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
    }

    .buying-column {
        position: static;
        order: 1;
    }

    .gallery-column {
        order: 0;
    }

    .gallery-main {
        min-height: 300px;
    }
}

/* Mobile Responsiveness Improvements */
@media (max-width: 768px) {
    .header-row {
        flex-direction: row;
        justify-content: space-between !important;
        padding-bottom: 5px;
    }

    .search-form {
        order: 3 !important;
        margin: 10px 0 0 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        flex: none !important;
    }

    .logo img {
        max-height: 40px;
    }

    .user-tools {
        gap: 15px;
    }

    .user-tool-item span {
        display: none;
    }

    .user-tool-item .cart-count-badge {
        display: flex !important;
        /* Forces the badge to stay visible on mobile */
    }

    .mobile-menu-toggle {
        display: block !important;
        order: 1;
    }

    .logo {
        order: 2;
    }

    .user-tools {
        order: 4;
    }

    .main-header nav {
        display: none;
        flex-direction: column;
        width: 100%;
        background: white;
        position: absolute;
        top: 100%;
        left: 0;
        box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
        padding: 20px;
        z-index: 999;
        box-sizing: border-box;
    }

    .main-header nav.active {
        display: flex;
    }

    .main-header nav a {
        padding: 10px 0;
        border-bottom: 1px solid #f1f1f1;
        width: 100%;
        display: block;
    }

    .dropdown-content {
        position: static;
        box-shadow: none;
        padding-left: 15px;
        display: block;
    }

    .cart-modal {
        width: 100% !important;
    }

    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .cart-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 15px;
        font-size: 20px;
    }

    .cart-count {
        padding: 2px 6px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .header-row {
        gap: 5px;
    }

    .logo span {
        font-size: 1.2rem;
    }
}