/* --- GENERAL PAGE STYLES --- */
.section-padding {
    padding: 60px 0;
}

.bg-light {
    background-color: var(--bg-light);
}

.section-title {
    font-family: var(--font-secondary);
    color: var(--primary-color);
    font-size: 2rem;
    text-transform: uppercase;
    margin-bottom: 30px;
    position: relative;
    letter-spacing: 1px;
}

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

/* Hero Grid Layout */
.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Top section: Slider takes 2 cols, banners take 1 */
    grid-template-rows: auto auto auto;
    gap: 15px;
    max-width: var(--container-max-width);
    margin: 0 auto;
}

/* On desktop, we want 3 equal columns for the bottom row. 
   So a 3-column grid is better: */
.hero-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(180px, auto);
    gap: 15px;
}

.hero-slider-area {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    min-height: 600px;
    background-color: #f0f0f0;
}

.grid-banner {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: transform var(--transition-fast);
}

.grid-banner:hover {
    transform: scale(1.02);
}

.grid-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.banner-top-right {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
}

.banner-bottom-right {
    grid-column: 3 / 4;
    grid-row: 2 / 3;
}

.banner-bottom-1 {
    grid-column: 1 / 2;
    grid-row: 3 / 4;
}

.banner-bottom-2 {
    grid-column: 2 / 3;
    grid-row: 3 / 4;
}

.banner-bottom-3 {
    grid-column: 3 / 4;
    grid-row: 3 / 4;
}

/* Slider internals (adjusted for new container) */
.slider-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.slide.active {
    opacity: 1;
    z-index: 10;
}

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

/* Slider Buttons */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 20;
    transition: background-color var(--transition-fast), color var(--transition-fast);
    color: var(--primary-color);
}

.slider-btn:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.prev-slide {
    left: 15px;
}

.next-slide {
    right: 15px;
}

.slider-btn svg {
    width: 20px;
    height: 20px;
}

.slider-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    border: 2px solid transparent;
}

.dot.active {
    background-color: var(--primary-color);
    border-color: var(--white);
}

/* Responsive Grid */
@media (max-width: 991px) {
    .hero-grid {
        grid-template-columns: 1fr 1fr;
    }
    .hero-slider-area {
        grid-column: 1 / 3;
        grid-row: 1 / 2;
    }
    .banner-top-right, .banner-bottom-right, .banner-bottom-1, .banner-bottom-2, .banner-bottom-3 {
        grid-column: span 1;
        grid-row: auto;
    }
}

@media (max-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }
    .hero-slider-area {
        grid-column: 1 / 2;
    }
    .banner-top-right, .banner-bottom-right, .banner-bottom-1, .banner-bottom-2, .banner-bottom-3 {
        grid-column: 1 / 2;
    }
}

/* Home About snippet */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 20px;
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.about-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

/* Home Categories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.category-card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    height: 300px;
    box-shadow: var(--shadow-sm);
    display: block;
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.category-card:hover img {
    transform: scale(1.05);
}

.category-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 30px 20px 20px;
    color: var(--white);
}

.category-overlay h3 {
    font-family: var(--font-secondary);
    font-size: 1.2rem;
    text-transform: uppercase;
    margin: 0;
}

/* Limited Offers */
.offers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.offer-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    height: 250px;
}

.offer-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.offer-content {
    position: absolute;
    bottom: 20px;
    right: 20px;
}

/* Home Products (Featured) */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.product-card {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.product-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
}

.product-info {
    padding: 20px;
}

.product-info h4 {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-category {
    font-size: 0.85rem;
    color: var(--primary-color);
    text-transform: uppercase;
    font-weight: 600;
}

/* Responsive Home */
@media (max-width: 991px) {
    .categories-grid, .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .about-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .offers-grid {
        grid-template-columns: 1fr;
    }
    
    .slide-content h1 {
        font-size: 2rem;
    }
    
    .hero-slider-area {
        min-height: 250px;
        background-color: transparent;
    }

    .slide img {
        object-fit: contain;
    }
    
    .offer-card {
        height: auto;
        aspect-ratio: 16/9;
    }
    
    .offer-card img {
        object-fit: contain;
        background-color: #fff;
    }
}

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

/* ==========================================================================
   SERVICIOS PAGE STYLES
   ========================================================================== */

.service-section {
    padding: 60px 0;
    border-bottom: 1px solid var(--border-color);
}

.service-section:last-child {
    border-bottom: none;
}

.service-section:nth-child(even) {
    background-color: var(--bg-light);
}

.service-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.service-grid.reverse .service-text {
    order: 2;
}
.service-grid.reverse .service-gallery-wrapper {
    order: 1;
}

.service-text h2 {
    font-family: var(--font-secondary);
    color: var(--primary-color);
    font-size: 2.2rem;
    margin-bottom: 20px;
}

.service-text p {
    color: var(--text-light);
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

/* 4-Image Grid Layout */
.service-gallery-wrapper {
    width: 100%;
}

.gallery-grid-4 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: repeat(3, 120px);
    gap: 15px;
}

.gallery-grid-4 .img-large {
    grid-column: 1 / 2;
    grid-row: 1 / 4;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal);
}

.gallery-grid-4 .img-small {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal);
}

.gallery-grid-4 .img-small:nth-child(2) {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}
.gallery-grid-4 .img-small:nth-child(3) {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
}
.gallery-grid-4 .img-small:nth-child(4) {
    grid-column: 2 / 3;
    grid-row: 3 / 4;
}

.gallery-grid-4 img:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-md);
}

/* Responsive adjustments for services */
@media (max-width: 991px) {
    .service-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .service-grid.reverse .service-text,
    .service-grid.reverse .service-gallery-wrapper {
        order: unset;
    }
    
    .service-text {
        text-align: center;
    }
}

@media (max-width: 575px) {
    .gallery-grid-4 {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
    }
    
    .gallery-grid-4 .img-large {
        grid-column: 1 / 3;
        grid-row: 1 / 2;
        height: 250px;
    }
    
    .gallery-grid-4 .img-small:nth-child(2) {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
        height: 150px;
    }
    .gallery-grid-4 .img-small:nth-child(3) {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
        height: 150px;
    }
    .gallery-grid-4 .img-small:nth-child(4) {
        grid-column: 1 / 3;
        grid-row: 3 / 4;
        height: 150px;
    }
}

/* ==========================================================================
   STOCK PAGES (5-IMAGE GALLERY & LIGHTBOX)
   ========================================================================== */

.stock-section {
    padding: 60px 0;
    border-bottom: 1px solid var(--border-color);
}

.stock-section:nth-child(even) {
    background-color: var(--bg-light);
}

.stock-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: flex-start;
}

.stock-text h2 {
    font-family: var(--font-secondary);
    color: var(--primary-color);
    font-size: 2.2rem;
    margin-bottom: 15px;
}

.stock-text p {
    color: var(--text-light);
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

/* J-Shaped Gallery (4 thumbnails surrounding 1 large main image) */
.stock-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto auto;
    gap: 15px;
}

.stock-gallery .img-main {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
    width: 100%;
    height: 100%;
    min-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal), opacity 0.15s ease-in-out;
}

.stock-gallery .thumbnails {
    display: contents; /* Allows thumbnails to become grid items of .stock-gallery */
}

.stock-gallery .thumbnails img {
    width: 100%;
    height: 100%;
    min-height: 120px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal);
}

/* Placement to form the "J" shape around the main image */
.stock-gallery .thumbnails img:nth-child(1) {
    grid-column: 3; 
    grid-row: 1;
}
.stock-gallery .thumbnails img:nth-child(2) {
    grid-column: 3; 
    grid-row: 2;
}
.stock-gallery .thumbnails img:nth-child(3) {
    grid-column: 3; 
    grid-row: 3;
}
.stock-gallery .thumbnails img:nth-child(4) {
    grid-column: 2; 
    grid-row: 3;
}

.stock-gallery img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

@media (max-width: 991px) {
    .stock-grid {
        grid-template-columns: 1fr;
    }
    .stock-gallery .img-main {
        height: 300px;
    }
}

@media (max-width: 575px) {
    .stock-gallery .thumbnails img {
        height: 70px;
    }
}

/* Lightbox Modal */
.lightbox-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-modal.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox-modal.active .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10000;
}

.lightbox-close:hover {
    color: var(--secondary-color);
}

/* Color Swatches for Product Descriptions */
.color-swatch-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 25px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.color-swatch-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--text-light);
}

.color-swatch {
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid #ccc;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}
