﻿/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito Sans', sans-serif;
    background: #FDF4E6; /* crema claro */
    color: #4B4B4B; /* gris oscuro */
    line-height: 1.6;
}

/* ===== Header ===== */
header {
    text-align: center;
    padding: 2rem;
    background: #F4C6CC; /* rosa suave */
    border-bottom: 2px solid rgba(0,0,0,0.05);
}

    header h1 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
        color: #A67C6B; /* marrón claro */
    }

    header p {
        font-size: 1rem;
        opacity: 0.9;
        color: #4B4B4B;
    }

/* ===== Layout principal ===== */
.portfolio-container {
    display: flex;
    min-height: calc(100vh - 100px);
}

/* ===== Menú lateral ===== */
.categories {
    width: 200px;
    background: #FDF4E6;
    padding: 1.2rem;
    border-right: 2px solid rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: calc(100vh - 100px);
    overflow-y: auto;
}

    .categories h2 {
        margin-bottom: 0.8rem;
        font-size: 1.1rem;
        color: #A67C6B;
    }

    .categories ul {
        list-style: none;
    }

    .categories li {
        padding: 0.6rem;
        margin-bottom: 0.4rem;
        cursor: pointer;
        border-radius: 6px;
        font-size: 0.95rem;
        transition: background 0.3s ease, color 0.3s ease;
        color: #4B4B4B;
    }

        .categories li:hover,
        .categories li.active {
            background: #F4C6CC;
            color: #A67C6B;
            font-weight: bold;
        }

        /* Opción de volver */
        .categories li.return-link {
            margin-top: 1.2rem;
            background: #A67C6B;
            color: #fff;
            text-align: center;
            font-weight: bold;
        }

            .categories li.return-link:hover {
                background: #4B4B4B;
            }

/* ===== Grid de productos ===== */
.products {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

/* ===== Animación ===== */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Cards ===== */
.product-card {
    background: #FFFFFF;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    height: 280px; /* más compacto */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
    padding-bottom: 0.4rem;
}

    .product-card:hover {
        transform: translateY(-4px);
    }

    .product-card img {
        width: 100%;
        height: 180px; /* más cuadrado */
        object-fit: cover;
        flex-shrink: 0;
    }

    .product-card h3 {
        padding: 0.5rem;
        font-size: 0.95rem;
        text-align: center;
        color: #A67C6B;
        flex-grow: 1;
    }

.btn-info {
    display: block;
    width: 90%;
    margin: 0 auto;
    padding: 0.5rem;
    background: #A67C6B;
    color: #FFFFFF;
    border: none;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
    border-radius: 4px;
}

    .btn-info:hover {
        background: #4B4B4B;
    }

/* ===== Modal ===== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow-y: auto;
    padding: 2rem;
}

    .modal.show {
        display: flex;
    }

.modal-content {
    background: #FFFFFF;
    color: #4B4B4B;
    border-radius: 12px;
    max-width: 850px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
    position: relative;
    animation: fadeInUp 0.5s ease forwards;
}

.close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #A67C6B;
}

.modal-left img {
    width: 100%;
    border-radius: 8px;
    object-fit: cover;
}

.modal-right h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: #A67C6B;
}

.modal-right .price {
    font-size: 1.1rem;
    font-weight: bold;
    color: #4B4B4B;
    margin-bottom: 1rem;
}

.modal-right .btn-add {
    display: inline-block;
    padding: 0.7rem 1rem;
    background: #A67C6B;
    color: #fff;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

    .modal-right .btn-add:hover {
        background: #4B4B4B;
    }

.modal-right .details {
    margin-top: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 992px) {
    .product-card {
        height: 260px;
    }

        .product-card img {
            height: 160px;
        }
}

@media (max-width: 600px) {
    .portfolio-container {
        flex-direction: column;
    }

    .categories {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 2px solid rgba(0,0,0,0.05);
        display: flex;
        overflow-x: auto;
        position: sticky;
        top: 0;
        z-index: 10;
    }

        .categories h2 {
            display: none;
        }

        .categories ul {
            display: flex;
            gap: 0.5rem;
        }

        .categories li {
            white-space: nowrap;
            padding: 0.6rem 1rem;
        }

    .products {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .product-card {
        height: 240px;
    }

        .product-card img {
            height: 140px;
        }
}


/* Link de regreso */
.return-link {
    font-size: small;
    margin-top: 2rem;
    text-align: center;
}

    .return-link a {
        display: block;
        background: #A67C6B; /* marrón claro */
        color: #fff;
        font-weight: bold;
        text-decoration: none;
        padding: 0.8rem;
        border-radius: 6px;
        transition: background 0.3s ease, transform 0.2s ease;
    }

        .return-link a:hover {
            background: #4B4B4B; /* gris oscuro */
            transform: translateY(-2px);
        }
