/* assets/css/styles.css - Modern Artisanal Aesthetics */

:root {
    --primary: #184922;
    --primary-light: #2c6136;
    --secondary: #2D2A26;
    --bg-creme: #FDF8F5;
    --text-main: #3D3935;
    --text-light: #7D756D;
    --white: #FFFFFF;
    --shadow: 0 10px 30px rgba(230, 92, 0, 0.08);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-creme);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* Header & Navigation */
header {
    background: var(--white);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.03);
}

.logo {
    width: 100%;
    max-width: 170px;
    margin: 0;
}

.logo img {
    width: 100%;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

/* Hamburger Menu */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1100;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--secondary);
    border-radius: 3px;
    transition: var(--transition);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        right: -100%;
        top: 0;
        width: 100%;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2.5rem;
        transition: all 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0);
        z-index: 1050;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.4s ease;
    }

    .nav-links.active li {
        opacity: 1;
        transform: translateY(0);
    }

    /* Escalonado de links */
    .nav-links.active li:nth-child(1) {
        transition-delay: 0.1s;
    }

    .nav-links.active li:nth-child(2) {
        transition-delay: 0.2s;
    }

    .nav-links.active li:nth-child(3) {
        transition-delay: 0.3s;
    }

    .nav-links.active li:nth-child(4) {
        transition-delay: 0.4s;
    }

    .nav-links li a {
        font-size: 2rem;
        font-weight: 800;
        color: var(--secondary);
    }
}

.nav-links a:hover {
    color: var(--primary);
}

.header-actions {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.cart-icon {
    position: relative;
    cursor: pointer;
}

/* Hero Slider */
.hero {
    height: 80vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.slide.active {
    opacity: 1;
}

.slide::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 2rem;
}

.hero-content h1 {
    font-size: 3.5rem;
    line-height: 3.2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}



/* Button Base */
.btn-primary,
.btn-outline {
    padding: 0.8rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
    text-align: center;
    transition: var(--transition);
    white-space: nowrap;
    cursor: pointer;
    border: 2px solid var(--primary);
    line-height: 1.2;
    height: 3rem;
    /* Fixed height for absolute equality */
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-3px);
}


.btnSlide {
    max-width: 200px;
    margin-top: 10px;
}

/* Breadcrumbs ************************************/
.breadcrumbs {
    padding: 1rem 5%;
    font-size: 0.9rem;
    color: var(--text-light);
}

.breadcrumbs a {
    color: var(--text-light);
}

.breadcrumbs span {
    margin: 0 0.5rem;
}



/* Product Detail Page ****************************************/
.product-detail-container {
    padding: 2rem 5% 5rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4rem;
    width: 100%;
}

@media (max-width: 900px) {
    .product-detail-container {
        grid-template-columns: 1fr;
    }
}

.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.main-img-container {
    width: 100%;
    aspect-ratio: 1/1;
    background-color: #eee;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 20px;
    box-shadow: var(--shadow);
}


.thumb-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    width: 100%;
}

.thumb-img {
    aspect-ratio: 1/1;
    background-color: #eee;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.thumb-img.active {
    border-color: var(--primary);
}

.product-detail-info .product-category {
    font-size: 0.9rem;
    letter-spacing: 2px;
}

.product-detail-info h1 {
    font-size: 3rem;
    margin: 0.5rem 0 1rem;
    color: var(--secondary);
    line-height: 3.2rem;
}

.product-detail-info .product-price {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 2rem;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border: 1px solid #eee;
    width: fit-content;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    margin: 2rem 0;
}

.quantity-selector button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--primary);
    font-weight: 700;
}

.quantity-selector input {
    width: 30px;
    text-align: center;
    border: none;
    font-size: 1.1rem;
    font-family: inherit;
    font-weight: 600;
}

/* Tabs ***************************************************/
.detail-tabs {
    margin-top: 4rem;
    border-top: 1px solid #eee;
    padding-top: 2rem;
}

.tabs-nav {
    display: flex;
    gap: 3rem;
    margin-bottom: 2rem;
}

.tab-btn {
    background: none;
    border: none;
    font-family: inherit;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    color: var(--text-light);
    cursor: pointer;
    position: relative;
    padding-bottom: 0.5rem;
}

.tab-btn.active {
    color: var(--secondary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
}

.tab-content {
    display: none;
    font-size: 1.1rem;
    color: var(--text-main);
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Products Grid ***********************************/
.products-section {
    padding: 5rem 5%;
}

.section-title {
    text-align: center;
    margin-bottom: 3.5rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
}

.product-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.02);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow);
}

.product-img {
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1/1;
    height: auto;
    background-color: #eee;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    margin: 0 auto;
}

.product-info {
    padding: 1.5rem;
}

.product-category {
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 1rem 0;
}

/* Category Filter */
.category-filter {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    background: var(--white);
    color: var(--text-main);
    font-weight: 600;
    border: 1px solid #eee;
    transition: var(--transition);
    cursor: pointer;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Sidebar Cart */
.cart-sidebar {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    /* Modern browsers fix for mobile address bar */
    background: var(--white);
    z-index: 2000;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
}

/* El wrapper interno lleva el scroll y el padding */
#cart-content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    padding-bottom: 12rem;
    /* Aumentamos sustancialmente para evitar que se tape */
    -webkit-overflow-scrolling: touch;
}

/* Ajuste para el contenedor de items para que no colapse */
#cart-items {
    min-height: 50px;
}

/* Scrollbar premium para el carrito */
#cart-content-wrapper::-webkit-scrollbar {
    width: 6px;
}

#cart-content-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#cart-content-wrapper::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

#cart-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

@media (max-width: 480px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }

    #cart-content-wrapper {
        padding: 1.2rem;
        padding-bottom: 12rem;
        /* Keep substantial padding on mobile */
    }
}

.cart-sidebar.open {
    right: 0;
}

/* Footer */
footer {
    background: var(--secondary);
    color: var(--white);
    padding: 5rem 5% 2rem;
}

.gallery-fade {
    animation: galleryFade 0.4s ease;
}

@keyframes galleryFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
}