/* ============================================
   ESTILOS TIENDA BUTROI
   Basado en el diseño de la web principal
   ============================================ */

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #292524;
    background-color: #fff;
    line-height: 1.6;
}

/* Contenedor principal */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container h1{
    margin: 2rem;
}

/* Header */
header {
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 0 0.3rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #b45309;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: #57534e;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #b45309;
}

.cart-icon {
    position: relative;
    cursor: pointer;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #b45309;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Hero section */
.hero {
    background: linear-gradient(135deg, #78716c 0%, #57534e 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.125rem;
    opacity: 0.9;
}

/* Grid de productos */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 3rem 0;
}

.producto-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.producto-card:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    transform: translateY(-4px);
}

.producto-imagen {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    cursor: pointer;
}

.producto-info {
    padding: 1.5rem;
}

.producto-nombre {
    font-size: 1.25rem;
    font-weight: 700;
    color: #292524;
    margin-bottom: 1rem;
}

/* Grid de dos columnas (caja 6 y caja 12) */
.cajas-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* Cuando solo hay una caja disponible ocupa todo el ancho */
.cajas-grid.caja-unica {
    grid-template-columns: 1fr;
}

/* Cada columna: label → precio → stock → botón */
.caja-opcion {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: #fafaf9;
    border-radius: 0.625rem;
    padding: 0.875rem 0.75rem 0.75rem;
}

.caja-label {
    font-size: 0.875rem;
    color: #57534e;
    line-height: 1.3;
}

.caja-precio {
    font-size: 1.25rem;
    font-weight: 700;
    color: #b45309;
}

.caja-stock {
    font-size: 0.8rem;
    color: #78716c;
    flex-grow: 1;
}

.stock-bajo {
    color: #dc2626;
    font-weight: 600;
}

/* Botón pegado al fondo de cada columna */
.btn-caja {
    margin-top: 0.5rem;
    width: 100%;
}

.btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #b45309;
    color: white;
}

.btn-primary:hover {
    background: #92400e;
}

.btn-secondary {
    background: #e7e5e4;
    color: #292524;
}

.btn-secondary:hover {
    background: #d6d3d1;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Carrito */
.carrito-vacio {
    text-align: center;
    padding: 4rem 0;
}

.carrito-vacio svg {
    width: 4rem;
    height: 4rem;
    color: #d6d3d1;
    margin-bottom: 1rem;
}

.carrito-items {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

.carrito-item {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid #e7e5e4;
}

.carrito-item:last-child {
    border-bottom: none;
}

.carrito-item-imagen {
    width: 100px;
    height: 150px;
    object-fit: cover;
    border-radius: 0.5rem;
}

.carrito-item-info h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.carrito-item-detalles {
    font-size: 0.875rem;
    color: #78716c;
    margin-bottom: 0.5rem;
}

.carrito-item-cantidad {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.cantidad-btn {
    width: 2rem;
    height: 2rem;
    border: 1px solid #d6d3d1;
    background: white;
    border-radius: 0.25rem;
    cursor: pointer;
    font-weight: 700;
}

.cantidad-btn:hover {
    background: #fafaf9;
}

.cantidad-input {
    width: 3rem;
    text-align: center;
    border: 1px solid #d6d3d1;
    border-radius: 0.25rem;
    padding: 0.25rem;
}

.carrito-item-precio {
    text-align: right;
}

.precio-unitario {
    font-size: 0.875rem;
    color: #78716c;
}

.precio-total {
    font-size: 1.25rem;
    font-weight: 700;
    color: #b45309;
}

.btn-eliminar {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.btn-eliminar:hover {
    text-decoration: underline;
}

/* Resumen del pedido */
.resumen-pedido {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    position: sticky;
    top: 6rem;
}

.resumen-pedido h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.resumen-linea {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e7e5e4;
}

.resumen-total {
    font-size: 1.25rem;
    font-weight: 700;
    padding-top: 1rem;
}

/* Formulario de checkout */
.checkout-form {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: #292524;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #57534e;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d6d3d1;
    border-radius: 0.5rem;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #b45309;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.metodo-pago-opciones {
    display: flex;
    gap: 1rem;
}

.metodo-pago-opcion {
    flex: 1;
    padding: 1rem;
    border: 2px solid #e7e5e4;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.metodo-pago-opcion:hover {
    border-color: #b45309;
}

.metodo-pago-opcion.selected {
    border-color: #b45309;
    background: #fef3c7;
}

.metodo-pago-opcion input[type="radio"] {
    margin-right: 0.5rem;
}

.transferencia-info {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}

.transferencia-info h4 {
    margin-bottom: 0.5rem;
    color: #92400e;
}

.transferencia-info p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
}

.transferencia-info strong {
    color: #292524;
}

/* Lightbox para imágenes */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: rgba(0,0,0,0.5);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Alertas */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #dc2626;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid #e7e5e4;
    border-top-color: #b45309;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .productos-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    .carrito-item {
        grid-template-columns: 100px 1fr;
        gap: 1rem;
    }

    .carrito-item-precio {
        grid-column: 2;
        text-align: left;
        margin-top: 0.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 1.75rem;
    }
    
    .resumen-pedido {
        position: static;
    }
}

/* Footer */
footer {
    background: #292524;
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

footer a {
    color: #fbbf24;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Layout para checkout y carrito */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
}

@media (max-width: 900px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }
}

/* Extra */
.hero{
    padding:0!important;
    background-image:url('../images/tienda.jpg');
    background-position: center center;
}
.hero .container{padding:3rem; background-color:#0007}
