:root{
    --blanco: #f4f2f3;
    --rosaClaro: #fbdce2;
    --rosa: #ff9fb2;
    --morado: #843b62;
    --negro: #201e1f;
}

body{
    margin: 0;
    padding: 0;
    font-family: fraunces;
    background-color: #f4f2f3;
    color: #201e1f;
}
h1{
    font-family: Cormorant;
    color: #7d2f6f;
    text-align: center;
    font-weight: bold;
}

.topbar{
    background: #fbdce2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    position: sticky;
    top: 0;
    flex-wrap: nowrap;
    overflow: hidden;
    z-index: 1000;
}

.perla{
    width: 180px;;
    height: auto;
}

.iconbutton img:not(.perla){
    width: 40px;
    height: auto;
}

.iconbutton{
    background-color: #fbdce2;
    border: none;
    cursor: pointer;
}


.topbaricons{
    display: flex;
    gap: 15px;

    transition:  transform 0.35s ease;
}

.topbaricons.menu-open {
    transform: translateX(-205px); 
}


.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25); 
    backdrop-filter: blur(4px);      
    opacity: 0;                      
    pointer-events: none;            
    transition: opacity 0.35s ease;
    z-index: 900;                   
}


.overlay.open {
    opacity: 1;
    pointer-events: auto;             
}


.side-Panel{
    position: fixed;
    top: 0px;
    right: -300px;
    width: 200px;
    height: 100%;
    background: #fbdce2;
    padding: 16px;
    transition: right 0.35s ease;
    display: flex;
    flex-direction: column;

    box-shadow: #201e1f;
    z-index: 2000;

}

.side-Panel.open {
    right: 0;
}

.search-box {
    width: 100%;
    margin-bottom: 18px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-box input{
    flex: 1;
    width: 90%;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #ff9fb2;
    font-size: 16px;
    outline: none;
    font-family: fraunces;
}

.search-box button{
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    background: #ff9fb2;
    color: white;
    font-size: 18px;
    cursor: pointer;
    font-family: fraunces;
}

.panel-categorias {
    list-style: none;
    padding: 0;
    margin: 0;
}

.panel-categorias li{
    padding: 14px 0;
    font-size: 18px;
    font-family: Cormorant;
    color: #201e1f;
    border-bottom: 1px solid #ff9fb2;
    cursor: pointer;
}

.hero{
    width: 100%;
    height: auto;
    padding-bottom: 20px;

}

.bienvenida{
    text-align: center;
    font-family: Fraunces;
    font-size: 35px;
    margin: 0;
    padding-top: 50px;
    color: #201e1f;
}

.bienvenidaimg{
    width: 100%;
    max-width: 900px;
    height: auto;
    display: block;
    margin: 0 auto;
    padding-top: 40px;
}


.banner-area {
    width: 100%;
    margin-top: 50px;
}

.banner-img {
    width: 100%;
    border-radius: 12px;
    object-fit: cover;
}


/* Sección de categorías */
.categorias {
    padding: 20px 10px;
    text-align: center;
}

/* Título */
.categorias h2 {
    font-family: Fraunces;
    font-size: 24px;
    color: var(--morado);
    margin: 50px;
}

/* GRID RESPONSIVE */
.grid-categorias {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 0 5px;
    margin-bottom: 40px;
}

/* Cada cuadrito */
.cat-card {
    position: relative;
    display: block;
    text-decoration: none;
    overflow: hidden;
    border-radius: 18px;
    box-shadow: 0 6px 15px #201e1fb5;

    aspect-ratio: 4/3;
    min-height: 150px;

    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;

    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cat-image{
    width: 100%;
    height: 100%;
    display: block;

    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Texto dentro */
.cat-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #201e1f85;
    color: #f4f2f3;
    font-family: Fraunces;
    font-size: 25px;
    font-weight: 700;
    padding: 10px;
    border-radius: 6px;
}

/* Animación tipo app */
.cat-card:active {
    transform: scale(0.94);
    background: var(--rosa);
}




/*productos*/

.brand-filters {
    padding: 10px 15px;
    margin-bottom: 25px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.filter-title {
    font-family: Cormorant;
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 10px;
    text-align: center;
}

.brand-list {
    display: flex;
    flex-wrap: wrap; /* Permite que las marcas se muevan a la siguiente línea en móvil */
    justify-content: center;
    gap: 10px;
}

.brand-link {
    text-decoration: none;
    padding: 8px 15px;
    border: 1px solid var(--gris);
    border-radius: 20px;
    color: var(--gris-oscuro);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    text-transform: uppercase;
    white-space: nowrap; /* Evita que los nombres de marca se rompan */
}

/* Estilo para el filtro activo */
.brand-link.active,
.brand-link:hover {
    background-color: var(--rosa);
    color: var(--blanco);
    border-color: var(--rosa);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* --- LAYOUT Y TÍTULO --- */

/* Asegura que el contenido tenga un poco de aire con el header */
.content {
    padding-top: 20px; 
}

.page-title {
    text-align: center;
    margin-bottom: 30px;
    font-family: Cormorant; 
    font-size: 32px;
    font-weight: 700;
    color: var(--morado);
    text-transform: uppercase;
}



/* La cuadrícula de productos (centrada y responsiva) */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); 
    gap: 60px;
    padding: 0 15px 40px; 
    max-width: 1200px; 
    margin: 0 auto; 
    
}

/* --- TARJETAS DE PRODUCTO (.producto-card) --- */

/* Contenedor general */
.producto-card {
    width: 100%;
    max-width: 310px;
    background: #ffffff;
    border-radius: 14px;
    padding: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform .2s;
    
}



/* Imagen */
.producto-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

/* Nombre */
.producto-card h3 {
    font-family: Fraunces;
    font-size: 18px;
    margin: 10px 0 5px;
    text-align: center;
    font-weight: bold;
}

/* Precio */
.producto-card .precio {
    font-size: 17px;
    font-weight: 600;
    color: #7d2f6f;
    
}

/* Formulario */
.form-add {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

/* Caja de cantidad */
.cantidad-box {
    display: flex;
    align-items: center;
    background: #f1f1f1;
    padding: 6px 10px;
    border-radius: 10px;
}

.cantidad-box label {
    font-size: 14px;
    margin-right: 8px;
    color: #333;
}

.cantidad-box input {
    width: 55px;
    padding: 4px;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 600;
}

/* Botón añadir */
.btn-add {
    flex-grow: 1;
    background: #ff9fb2;
    padding: 10px 5px;

    color: #f4f2f3;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

.btn-add:hover {
    background: #7d2f6f;
}

/* Diseño responsive */
@media (max-width: 500px) {
    .producto-card {
        max-width: 100%;
    }

    .form-add {
        flex-direction: column;
        align-items: stretch;
    }

    .cantidad-box {
        justify-content: center;
        width: 100%;
    }

    .btn-add {
        width: 100%;
    }
}



/* --- ESTILOS PARA LA BÚSQUEDA DENTRO DE CATEGORÍA (Local) --- */

.category-search-box {
    padding: 10px 15px;
    margin-bottom: 15px; /* Menos margen porque está cerca del filtro */
}

.category-search-box form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    border: 2px solid var(--rosa);
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--blanco);
}

.local-search-input {
    flex-grow: 1; 
    padding: 12px 15px;
    border: none;
    font-size: 16px;
    outline: none;
    font-family: Fraunces;
}

.local-search-button {
    background-color: var(--rosa);
    color: white;
    padding: 10px 15px;
    border: none;
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.2s;
}

.local-search-button:hover {
    background-color: var(--morado);
}

/* --- ESTILOS PARA LOS FILTROS POR MARCA --- */

.brand-filters {
    padding: 0 15px 20px;
    border-top: 1px solid #eee;
}

.filter-title {
    font-family: Cormorant;
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 10px;
    text-align: center;
}

.brand-list {
    display: flex;
    flex-wrap: wrap; 
    justify-content: center;
    gap: 8px;
}

.brand-link {
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid var(--gris);
    border-radius: 15px;
    color: var(--gris-oscuro);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    text-transform: uppercase;
    white-space: nowrap;
}

.brand-link.active,
.brand-link:hover {
    background-color: var(--rosa);
    color: var(--blanco);
    border-color: var(--rosa);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Media Query para layout de PC */
@media (min-width: 768px) {
    .productos-grid {
        grid-template-columns: repeat(4, 1fr); 
    }
}

.empty-cart-message{
    font-family: Fraunces ;
    text-align: center;
    color: #201e1f;
    font-size: large;

}

.auth-message{
    font-family: Fraunces;
    text-align: center;
    color: #201e1f;
    font-size: 30px;
}

.IniSes{
    font-family: Cormorant ;
    font-weight: bold;
    color: #843b62;
    font-style: italic;
}

.iratienda{
    background-color: #ff9fb2;
   border: none;
   border-radius: 15px;
   text-decoration: none;
   padding: 15px;
   display: block;
   margin: 0 auto;
   cursor: pointer;
}

.btn-main-action{
    color: #f4f2f3;
    text-decoration: none;
    font-family: Cormorant;
    font-weight: bold;
    font-size: 20px;
}

.auth-container{
    background: #fbdce2;
    border-radius: 10px;
    margin: 70px;
    margin-left: 50px;
    margin-right: 50px;
}

.page-title{
    font-family: Fraunces;
    font-size: 30px;
    color: #7d2f6f;
    margin: 40px;
    padding: 10px;
    font-size: 30px;
}

.auth-form label{
    display: block;
    margin: 15px ;
    font-family: Fraunces;
    text-align: center;
    font-size: 20px;
    font-style: oblique;
    font-weight: 250px;
}

.auth-form input{
    border-radius: 5px;
    margin: auto;
    display: block;
    align-items: center;
    margin-bottom: 20px;
    font-size: large;
    padding: 13px;
}


.auth-form button{
    background-color: #ff9fb2;
   border: none;
   border-radius: 15px;
   text-decoration: none;
   padding: 15px;
   display: block;
   margin: 0 auto;
   cursor: pointer;
   
   

   font-family: Cormorant;
}

.auth-footer{
    text-align: center;
    font-family: Fraunces;
    font-style: italic;
    margin: 30px;
    padding: 10px;
}

.auth-footer a{
    color: #7d2f6f;
}

/* CONTENEDOR DEL MENÚ DE PERFIL */
.menu-perfil {
    position: absolute;
    top: 70px; /* justo debajo del topbar */
    right: 15px; /* pegado al icono del usuario */
    
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 10px 0;

    width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: 0.25s ease;

    z-index: 999;
}

/* ESTADO ABIERTO */
.menu-perfil.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* LISTA */
.menu-perfil ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ITEMS */
.menu-perfil li {
    padding: 12px 18px;
    font-family: "Fraunces";
    font-size: 16px;
    cursor: pointer;
    transition:  0.2s;
}

/* Primer item (“Hola, X”) */
.menu-perfil li:first-child {
    font-family: Fraunces;
    font-weight: bold;
    cursor: default;
}

/* Hover */
.menu-perfil li:hover:not(:first-child) {
    background: #ffe3e9;
}

.admin-container { 
    max-width: 1000px; margin: 20px auto; padding: 0 15px; 
}
        
.admin-table { 
    width: 100%; border-collapse: collapse; margin-top: 20px;
 }
       
.admin-table th, .admin-table td { 
    border: 1px solid #ddd; padding: 10px; text-align: left; 
}
        
.admin-table th {
     background-color: var(--rosaClaro); color: var(--morado); 
}
        
.action-links a { 
    margin-right: 10px; text-decoration: none; color: var(--morado); 
}
        
.action-links a:hover { 
    text-decoration: underline; 
}
        
.add-product-btn { 
    font-size: Fraunces;
    display: inline-block; 
    padding: 10px 15px; 
    background-color: var(--rosa); 
    color: #f4f2f3; 
    text-decoration: none; 
    border-radius: 5px; 
    margin-bottom: 20px; 
}


/* CONTENEDOR DEL FORMULARIO */
.edit-container {
    max-width: 650px;
    margin: 40px auto;
    padding: 25px;
    background-color: var(--rosaClaro);
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    animation: fadeIn 0.4s ease-in-out;
}

/* TITULOS */
.edit-container h2 {
    text-align: center;
    font-size: 26px;
    font-weight: bold;
    color: var(--morado);
    margin-bottom: 20px;
}

/* GRUPOS DEL FORM */
.form-group {
    margin-bottom: 18px;
    width: 100%;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-left: 10px;
    margin-bottom: 6px;
    color: var(--morado);
    margin-bottom: 6px;
    font-size: 15px;
    font-family: Cormorant;
}

/* INPUTS Y SELECTS */
.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 93%; 
    padding: 12px;
    border: 2px solid var(--rosa);
    border-radius: 10px;
    outline: none;
    font-size: 15px;
    background: #f4f2f3;
    transition: 0.2s ease;
    margin: 0 auto; 
    display: block;
}


.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--morado);
    box-shadow: 0 0 4px var(--morado);
}

/* ÁREA DE DESCRIPCIÓN */
.form-group textarea {
    resize: vertical;
}

/* ACCIONES DEL FORMULARIO */
.form-actions {
    margin-top: 25px;
    text-align: center;
}

/* BOTÓN GUARDAR */
.btn-update {
    padding: 12px 25px;
    background-color: var(--rosa);
    color: var(--blanco);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.25s ease;
}

.btn-update:hover {
    background-color: var(--morado);
    transform: scale(1.03);
}

/* MENSAJES */
.message-success,
.message-error {
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 15px;
}

.message-success {
    background-color: #e8ffe8;
    color: #1f8b1f;
    border: 1px solid #1f8b1f;
}

.message-error {
    background-color: #ffe0e0;
    color: #c00000;
    border: 1px solid #c00000;
}

/* LINK VOLVER */
.back-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--morado);
    font-weight: bold;
    text-decoration: none;
    font-size: 35px;
}


/* ANIMACIÓN */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* RESPONSIVO — MÓVIL */
@media (max-width: 480px) {
    .edit-container {
        padding: 20px;
        margin: 20px;
    }

    .edit-container h2 {
        font-size: 22px;
    }

    .btn-update {
        width: 100%;
    }
}


/* ===========================
   CARRITO — ESTILOS GENERALES
   =========================== */

.content-carrito {
    max-width: 900px;
    margin: 100px auto 30px;
    padding: 20px;
    font-family: "Cormorant", serif;
}

.page-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: #333;
}

/* ---------------------------
   Mensajes vacíos / login
   --------------------------- */

.empty-cart-message,
.auth-message {
    text-align: center;
    background: #fff6f6;
    padding: 15px;
    border-radius: 12px;
    font-size: 1.1rem;
    margin: 20px auto;
    color: #b92c2c;
}

.auth-message a {
    color: #8a1e8d;
    font-weight: bold;
    text-decoration: underline;
}

/* -------------------------
   LISTA DEL CARRITO
   ------------------------- */

.carrito-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 20px;
}

/* -------------------------
   CARD DE CADA PRODUCTO
   ------------------------- */

.carrito-item {
    display: flex;
    gap: 15px;
    background: #ffffff;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.08);
    align-items: center;
    border: 1px solid #f2f2f2;
    transition: transform .15s;
}

.carrito-item:hover {
    transform: scale(1.02);
}

/* Imagen */
.item-img {
    width: 95px;
    height: 95px;
    object-fit: contain;
    border-radius: 10px;
    background: #fafafa;
    padding: 8px;
}

/* Texto */
.item-details {
    flex-grow: 1;
}

.item-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.item-price,
.item-quantity {
    font-size: 1rem;
    color: #444;
    margin: 3px 0;
}

/* Total */
.item-total {
    font-size: 1.1rem;
    font-weight: 600;
    min-width: 110px;
    text-align: right;
}

/* --------------------------
   BOTÓN ELIMINAR
   -------------------------- */

.btn-eliminar {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.9rem;
    background: #ff4b4b;
    color: white;
    padding: 5px 12px;
    border-radius: 10px;
    text-decoration: none;
    transition: background .2s;
}

.btn-eliminar:hover {
    background: #d93636;
}

/* ------------------------
   RESPONSIVE
   ------------------------ */

@media (max-width: 480px) {
    .carrito-item {
        flex-direction: column;
        text-align: center;
        padding: 18px;
    }

    .item-total {
        text-align: center;
        margin-top: 10px;
    }

    .item-img {
        width: 110px;
        height: 110px;
    }
}
