/* Reset CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Variables */
:root {
    --primary-color: #7D5A3C;
    --secondary-color: #F4A300;
    --bg-color: #f9f9f9;
    --text-color: #333;
    --light-text-color: #666;
    --font-family: 'Poppins', sans-serif;
}

/* Base Styles */
body {
    font-family: var(--font-family);
    line-height: 1.6;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

img {
    max-width: 100%;
    height: auto;
    display: block; /* Ensure images behave as blocks by default */
}

/* Header */
header {
    background: white;
    color: var(--text-color);
    text-align: center;
    padding: 1rem 0;
    box-shadow: 0 0.2rem 0.4rem rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 1rem;
}

header .logo {
    max-height: 5rem;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    color: var(--primary-color);
}

/* Navigation */
nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin: 0 1rem;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: var(--secondary-color);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--primary-color);
}

/* Main */
main {
    padding: 2rem 1rem;
    margin: 2rem auto;
    max-width: 1200px;
}

/* Sections */
section {
    background: white;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.2rem 0.4rem rgba(0, 0, 0, 0.1);
    position: relative; /* Keep relative for consistent section styling */
    overflow: hidden; /* Keep overflow hidden for consistent section styling */
}

section h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

section p {
    font-size: 1rem; /* Adjusted font size for paragraphs */
    color: var(--light-text-color);
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* --- Home Section Styling --- */
#home {
    text-align: center;
    background-color: var(--bg-color); /* Changed background to solid color */
    position: relative; /* Keep relative */
    color: var(--text-color); /* Ensure text color is readable on the new background */
    padding: 4rem 2rem; /* Add some padding */
    display: flex; /* Use flexbox to center content vertically and horizontally */
    flex-direction: column; /* Stack items vertically */
    justify-content: center; /* Center items vertically */
    align-items: center; /* Center items horizontally */
    min-height: 80vh; /* Give the home section a minimum height */
}

#home .home-logo {
    max-width: 80%; /* Adjust logo size */
    max-height: 40vh; /* Adjusted max height to 40% of viewport height */
    width: auto; /* Allow width to adjust based on height and aspect ratio */
    height: auto; /* Maintain aspect ratio */
    margin-bottom: 1.5rem; /* Space between logo and paragraph */
    display: block; /* Ensure it behaves as a block */
    margin-left: auto; /* Center the logo horizontally */
    margin-right: auto; /* Center the logo horizontally */
}

#home p {
    color: var(--text-color); /* Ensure text color is readable */
    font-size: 1.2rem;
    text-align: center; /* Center the paragraph */
    max-width: 800px; /* Optional: limit paragraph width */
}


/* --- Quiénes Somos Section Styling --- */
#quienes-somos .quienes-somos-content {
    display: flex; /* Use flexbox for text and image layout */
    flex-wrap: wrap; /* Allow stacking on smaller screens */
    gap: 2rem; /* Space between text and images */
    align-items: flex-start; /* Align items at the start */
    justify-content: center; /* Center content horizontally within the section */
}

#quienes-somos .quienes-somos-text {
    flex: 2; /* Allow text section to take more space */
    min-width: 300px; /* Minimum width for text before wrapping */
    max-width: 60%; /* Limit text width to make room for image */
}

#quienes-somos .quienes-somos-images {
    flex: 1; /* Allow image section to take remaining space */
    display: flex; /* Use flexbox for the single image */
    justify-content: center; /* Center the image horizontally */
    align-items: center; /* Center the image vertically */
    min-width: 200px; /* Minimum width for image section */
    max-width: 30%; /* Limit image container width */
}

#quienes-somos .quienes-somos-images img {
    display: block; /* Ensure images behave as blocks within the grid */
    max-width: 100%; /* Images take full width of their container */
    max-height: 400px; /* Limit image height to maintain proportion */
    height: auto; /* Maintain aspect ratio */
    border-radius: 8px; /* Rounded corners for images */
    transition: transform 0.3s ease-in-out, filter 0.3s ease-in-out; /* Transition for effect */
    filter: grayscale(50%); /* Initial grayscale effect */
}

#quienes-somos .quienes-somos-images img:hover {
    transform: scale(1.05); /* Slight zoom on hover */
    filter: grayscale(0%); /* Remove grayscale on hover */
}


/* Accordion Styling */
.accordion-item {
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden; /* Hide content overflow */
}

.accordion-header {
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    padding: 15px;
    width: 100%;
    text-align: left;
    border: none;
    outline: none;
    transition: background-color 0.3s ease;
    font-size: 1.1rem;
    font-weight: 500;
    position: relative; /* Needed for absolute positioning of ::after */
}

.accordion-header:hover {
    background-color: #6a4c32; /* Darken on hover - using a specific color as darken() is a SASS function */
}

/* Accordion indicator (arrow) */
.accordion-header::after {
    content: '\203A'; /* Unicode for right arrow (>) */
    font-size: 1.5rem; /* Adjust size as needed */
    color: white;
    font-weight: bold;
    position: absolute;
    right: 15px; /* Position it on the right */
    top: 50%; /* Vertically center */
    transform: translateY(-50%) rotate(90deg); /* Rotate to point down initially */
    transition: transform 0.3s ease-in-out; /* Smooth rotation */
}

.accordion-header.active::after {
    transform: translateY(-50%) rotate(270deg); /* Rotate to point up when active */
}


.accordion-content {
    padding: 0 15px;
    background-color: #f1f1f1;
    max-height: 0; /* Initially hidden */
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out; /* Transition for smooth slide */
}

.accordion-content p {
    padding: 15px 0; /* Add padding to the paragraph inside content */
    margin-bottom: 0; /* Remove default paragraph margin */
    font-size: 1rem; /* Ensure paragraph font size consistency */
    text-align: justify; /* Justify text in Quiénes Somos paragraphs */
}

/* State when accordion is active */
.accordion-header.active + .accordion-content {
    max-height: 500px; /* Adjust this value as needed to fit your content */
    padding: 15px; /* Restore padding when active */
}


/* --- End Quiénes Somos Section Styling --- */


/* Products Section */
#productos {
    display: block;
    gap: 2rem;
}

.productos-categoria {
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 0.2rem 0.4rem rgba(0, 0, 0, 0.1);
    padding: 1rem;
    margin-bottom: 2rem;
    text-align: center; /* Center the p and cta within the category */
}

.productos-categoria h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    text-align: center;
}

/* Container for titles and grid to manage layout */
.product-details-container {
    margin-bottom: 20px; /* Space below the titles and grid */
    text-align: left; /* Reset text alignment for contents */
}

.product-titles {
    display: flex;
    justify-content: space-around;
    width: 100%;
    flex-wrap: wrap;
    margin-bottom: 10px; /* Space between titles and images */
}

.product-title-item {
     flex: 1; /* Allow divs to grow and shrink */
     min-width: 200px; /* Minimum width before wrapping */
     margin: 0 10px; /* Add some horizontal margin */
     text-align: center; /* Center the title */
}

.product-title-item h4 {
    margin: 0; /* Remove default h4 margin */
     color: var(--primary-color);
}


/* Styling for the four images in parallel */
.productos-grid.four-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Create responsive columns */
    gap: 15px; /* Space between images */
    justify-items: center; /* Center images within grid items */
}

.productos-grid .producto-item {
    width: 100%;
    text-align: center;
    overflow: hidden; /* Hide overflowing parts during zoom and rounding */
}


.productos-grid .producto-item img {
    transition: transform 0.3s ease; /* Add transition for smooth zoom */
    border-radius: 10px; /* Added rounded corners to images */
    display: block; /* Ensure images behave as blocks */
    max-width: 100%; /* Ensure images are responsive */
    height: auto;
    /* You might want to add object-fit: cover; and a fixed height for uniform image sizes */
}

.productos-grid .producto-item img:hover {
    transform: scale(1.1); /* Zoom effect on hover */
}


/* Centering the CTA button within productos-categoria */
.productos-categoria .cta {
    display: inline-block; /* Keep it inline-block or block */
    margin: 20px auto 0 auto; /* Center horizontally with auto margins, add top margin */
    text-align: center; /* Center text inside button if needed */
}


/* Compra Section */
#compra {
    text-align: center;
}

.compra-opciones {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.compra-opciones a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    color: white;
    background-color: var(--secondary-color);
    padding: 1rem 2rem;
    border-radius: 50px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.compra-opciones a:hover {
    background-color: var(--primary-color);
    transform: scale(1.05);
}

.compra-opciones i {
    font-size: 1.5rem;
}

/* --- Blog Section Styling --- */
#blog {
     text-align: center; /* Center the articles container and button */
}

#blog .blog-articles-container {
    display: flex; /* Arrange articles in a row */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 2rem; /* Space between articles */
    justify-content: center; /* Center the articles horizontally */
    margin-bottom: 2rem; /* Space between articles and button */
}

#blog article {
    flex: 1; /* Allow articles to grow and shrink */
    min-width: 280px; /* Minimum width for articles */
    border: 1px solid #ddd; /* Add a border for definition */
    border-radius: 8px; /* Rounded corners for the article boxes */
    padding: 1.5rem; /* Add padding inside the box */
    box-shadow: 0 0.1rem 0.3rem rgba(0, 0, 0, 0.08); /* Subtle shadow */
    text-align: left; /* Align text inside the article to the left */
    margin-bottom: 0; /* Remove bottom margin as gap is handled by container */
}

#blog article:last-child {
    border-bottom: 1px solid #ddd; /* Restore border bottom as they are boxed */
}

#blog article h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.8rem; /* Slightly more space below title */
    text-align: center; /* Center the article titles */
}

#blog article p {
    font-size: 1rem; /* Consistent paragraph font size */
    margin-bottom: 0; /* Remove bottom margin from last paragraph in article */
    text-align: left; /* Ensure paragraph text is left-aligned */
}

/* Style for the "Conoce Más" button */
#blog #conoce-mas-blog {
    margin-top: 1rem; /* Space above the button */
    /* Inherits .cta styles */
}


/* --- Contact Section Styling --- */
#contacto .contacto-info {
    display: flex; /* Arrange paragraphs in a row */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    justify-content: space-around; /* Distribute space around paragraphs */
    gap: 1rem; /* Space between paragraphs */
}

#contacto p {
    flex: 1; /* Allow paragraphs to grow and shrink */
    min-width: 250px; /* Minimum width before wrapping */
    text-align: center; /* Center the text within each paragraph */
    margin-bottom: 0.5rem; /* Adjust margin */
}

#contacto p i {
    margin-right: 0.5rem; /* Espacio entre el ícono y el texto */
    color: var(--secondary-color); /* Color de los íconos */
    font-size: 1.2rem; /* Tamaño de los íconos */
}

#contacto a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

#contacto a:hover {
    color: var(--primary-color);
}

/* Footer */
footer {
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 1rem;
    position: relative;
    width: 100%;
}

/* Utility Classes */
.cta {
    display: inline-block;
    background-color: var(--secondary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.cta:hover {
    background-color: var(--primary-color);
    transform: scale(1.05);
}

/* Media Queries */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    header h1 {
        margin-bottom: 0.5rem;
    }

    nav {
        width: 100%;
        display: none;
    }

    nav ul {
        flex-direction: column;
        align-items: flex-start;
    }

    nav ul li {
        margin: 0.5rem 0;
    }

    .menu-toggle {
        display: block;
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: none;
        border: none;
        font-size: 2rem;
        cursor: pointer;
        color: var(--primary-color);
    }

    nav.active {
        display: block;
    }

    .menu-toggle.active {
        /* Estilos opcionales para el botón cuando el menú está abierto  */
    }

    #home {
        padding: 3rem 1rem; /* Adjust padding for smaller screens */
    }

    #home .home-logo {
         max-width: 90%; /* Increase logo size slightly on small screens */
    }


    #productos {
        grid-template-columns: 1fr;
    }

    .product-details-container {
        flex-direction: column;
        align-items: center;
    }

    .product-titles {
         flex-direction: column; /* Stack titles on smaller screens */
         align-items: center;
    }

     .product-title-item {
        margin: 5px 0; /* Adjust margin for stacked titles */
     }


    #compra {
        text-align: center;
    }

    .compra-opciones {
        flex-direction: column;
        align-items: center;
    }

    footer {
        position: relative;
    }

    /* Adjusted grid for smaller screens */
    .productos-grid.four-columns {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* Slightly smaller min-width for images */
    }

     /* Ensure the CTA button is centered on small screens */
     .productos-categoria .cta {
        display: block; /* Ensure it takes up its own line */
        margin: 20px auto 0 auto; /* Center horizontally */
     }

     /* Quiénes Somos responsiveness */
     #quienes-somos .quienes-somos-content {
         flex-direction: column; /* Stack text and images */
     }

     #quienes-somos .quienes-somos-text,
     #quienes-somos .quienes-somos-images {
         flex: none; /* Remove flex grow/shrink */
         width: 100%; /* Take full width */
         min-width: 0; /* Reset min-width */
     }

     /* Blog article responsiveness */
     #blog .blog-articles-container {
         flex-direction: column; /* Stack articles on smaller screens */
         gap: 1rem; /* Adjust gap */
     }

     #blog article {
        min-width: auto; /* Remove min-width constraint */
     }

    /* Contact info responsiveness */
     #contacto .contacto-info {
         flex-direction: column; /* Stack contact info */
         gap: 0.5rem; /* Adjust gap */
     }

     #contacto p {
         min-width: auto; /* Remove min-width constraint */
         margin-bottom: 0; /* Remove bottom margin */
     }
}