:root {
    --primary: #4a3728;
    --secondary: #cda434;
    --light: #f4f4f4;
    --dark: #222;
    --white: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--light);
    color: var(--dark);
}

header {
    background: var(--white);
    padding: 1rem 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.logo img {
    height: 50px;
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2.5rem;
    padding: 0;
    margin: 0;
    align-items: center;
}

nav ul li a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    position: relative;
}

nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--secondary);
    transition: width 0.3s ease;
}

nav ul li a:hover {
    color: var(--secondary);
}

nav ul li a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--dark);
    border-radius: 3px;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    nav ul {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background-color: var(--white);
        flex-direction: column;
        justify-content: center;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        gap: 3rem;
    }

    nav ul.active {
        right: 0;
    }

    nav ul li a {
        font-size: 1.2rem;
    }

    /* Animación del botón hamburguesa */
    .menu-toggle.open span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    .menu-toggle.open span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.open span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}

.hero-wrapper {
    position: relative;
    height: 60vh;
    width: 100%;
    overflow: hidden;
}

.hero {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center bottom;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--white);
    text-align: center;
    animation: slideUp 15s infinite linear;
    opacity: 0;
    transition: opacity 2s ease-in-out;
    z-index: 1;
}

.hero.active {
    opacity: 1;
    z-index: 2;
}

@keyframes slideUp {
    0% { background-position: center bottom; }
    50% { background-position: center top; }
    100% { background-position: center bottom; }
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.hero-content p {
    margin-bottom: 2rem;
}

.btn-main {
    background: var(--secondary);
    color: var(--white);
    padding: 1rem 2rem;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    transition: transform 0.2s;
    display: inline-block;
}

.btn-main:hover {
    transform: scale(1.05);
}

.products {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.products h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
}

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

.card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card:hover {
    transform: translateY(-10px);
}

.card img {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.price {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 1rem 0;
    color: var(--primary);
}

.btn-buy {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
}

.admin-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.btn-add-prod {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-add-prod:hover {
    background: #b58f2d;
}

.admin-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.admin-card {
    background: white;
    padding: 1rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.admin-inputs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex: 1;
    align-items: center;
}

.admin-card input {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    flex: 1;
    min-width: 120px;
}

.img-upload-wrapper input {
    flex: 2;
    border-color: var(--secondary);
    font-weight: bold;
}

.btn-delete {
    background: #ff4d4d;
    color: white;
    border: none;
    padding: 0.5rem 0.8rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.2s;
}

.btn-delete:hover {
    background: #cc0000;
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 30px;
    cursor: pointer;
    color: #888;
    transition: color 0.3s;
    z-index: 10;
}

.close:hover {
    color: var(--dark);
}

.cart-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.product-detail .modal-content {
    max-width: 800px;
}

.detail-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    text-align: left;
}

.zoom-container {
    position: relative;
    width: 60%;
    display: inline-block;
    overflow: hidden;
}

#zoom-lens {
    position: absolute;
    border: 1px solid #d4d4d4;
    width: 150px;
    height: 150px;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    cursor: crosshair;
    pointer-events: none;
    z-index: 10;
    display: none;
    background-repeat: no-repeat;
    background-color: white;
}

.detail-container img {
    width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: block;
}

.detail-info {
    width: 40%;
}

.detail-info h2 {
    margin-top: 0;
    font-size: 2.5rem;
}

.detail-info p {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.fullscreen-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
}

.fullscreen-modal img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.close-fs {
    position: absolute;
    right: 30px;
    top: 20px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2100;
}

.close-fs:hover {
    color: var(--secondary);
}

.cart-total {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 1rem 0;
}

@media (max-width: 992px) {
    .admin-card {
        flex-direction: column;
        text-align: center;
    }

    .admin-inputs {
        flex-direction: column;
        width: 100%;
    }

    .admin-card input {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .detail-container {
        flex-direction: column;
    }
    .detail-container img, .detail-info {
        width: 100%;
    }
}
/* ===================== v2: carrito, WhatsApp y avisos ===================== */

.logo a { display: inline-block; line-height: 0; }

.cart-empty { color: #777; margin: 1.5rem 0; }

#cart-modal .modal-content { max-width: 560px; text-align: left; }
#cart-modal h2 { text-align: center; }

.cart-item {
    display: grid;
    grid-template-columns: 64px 1fr auto auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}
.cart-item img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    background: #fff;
    border-radius: 6px;
}
.cart-item-info { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.95rem; }
.cart-item-info span { color: #666; font-size: 0.85rem; }
.talla-label { font-size: 0.85rem; color: var(--dark); display: flex; align-items: center; gap: 0.4rem; }
.talla-input {
    width: 4.5rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}
.talla-input:focus, .checkout-input:focus { outline: 2px solid var(--secondary); border-color: var(--secondary); }

.qty { display: flex; align-items: center; gap: 0.4rem; }
.qty button {
    width: 30px; height: 30px;
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}
.qty span { min-width: 1.2rem; text-align: center; font-weight: bold; }
.cart-remove {
    border: none; background: none; color: #999; cursor: pointer; font-size: 1.1rem; padding: 0.25rem;
}
.cart-remove:hover { color: #cc0000; }

.cart-total { text-align: right; }

.checkout-label { display: block; font-weight: bold; margin-bottom: 0.35rem; }
.checkout-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.7rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}
.checkout-error { color: #c0392b; min-height: 1.2em; margin: 0.5rem 0; font-size: 0.9rem; }
.checkout-note { color: #666; font-size: 0.85rem; text-align: center; margin: 0.75rem 0 0; }

.btn-whatsapp {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #25D366;
    color: #fff;
    border: none;
    padding: 0.95rem 1.5rem;
    border-radius: 5px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
}
.btn-whatsapp:hover { background: #1ebe5a; }

.wa-float {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    z-index: 1500;
    transition: transform 0.2s;
}
.wa-float:hover { transform: scale(1.08); }

footer { text-align: center; padding: 1.5rem 1rem 5rem; color: #666; font-size: 0.9rem; }
.footer-wa { color: var(--primary); font-weight: bold; }

#toast {
    position: fixed;
    left: 50%;
    bottom: 30px;
    transform: translate(-50%, 20px);
    background: var(--dark);
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 30px;
    font-size: 0.9rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 3000;
    max-width: 85vw;
    text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 480px) {
    .cart-item { grid-template-columns: 52px 1fr auto; }
    .cart-item img { width: 52px; height: 52px; }
    .cart-remove { grid-column: 3; grid-row: 1; align-self: start; }
    .qty { grid-column: 2 / 4; }
    .hero h1 { font-size: 2.2rem; }
}

/* Catálogo en 2 columnas en celular */
@media (max-width: 600px) {
    .products { padding: 0 1rem; margin: 2.5rem auto; }
    .products h2 { font-size: 1.9rem; margin-bottom: 1.5rem; }
    .grid { grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
    .card { padding: 0.8rem; }
    .card:hover { transform: none; }
    .card img { max-height: 130px; margin-bottom: 0.5rem; }
    .card h3 { font-size: 0.95rem; margin: 0.3rem 0; }
    .card p { font-size: 0.8rem; margin: 0.2rem 0; color: #666; }
    .price { font-size: 1.2rem; margin: 0.5rem 0; }
    .btn-buy { padding: 0.65rem 0.4rem; font-size: 0.8rem; }
}

/* v3: color */
.card-colors { font-size: 0.85rem; color: #777; margin: 0.3rem 0 0; }
.color-input {
    padding: 0.35rem 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    background: #fff;
    max-width: 10rem;
}
.cart-item-info .talla-label { margin-top: 0.15rem; }
.detail-color { margin: 0 0 1rem; }
.detail-color .color-input { font-size: 1rem; padding: 0.5rem; }
@media (max-width: 600px) { .card-colors { font-size: 0.72rem; } }

/* v4: número de pedido */
.btn-whatsapp { box-sizing: border-box; }
.btn-whatsapp.loading { opacity: 0.6; cursor: wait; }
.order-done { text-align: center; padding: 1rem 0; }
.order-done-title { font-size: 1.4rem; margin: 0 0 0.5rem; }
.order-done-title strong { color: var(--primary); }
.order-done .btn-whatsapp { text-decoration: none; margin: 1.25rem 0 0.75rem; }
.btn-new-order {
    width: 100%;
    background: none;
    border: 1px solid #ccc;
    padding: 0.8rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

/* v5: datos del cliente */
.checkout-section { font-family: 'Playfair Display', serif; font-size: 1.2rem; font-weight: 700; margin: 1.25rem 0 0.5rem; }
#checkout-box .checkout-label { margin-top: 0.85rem; font-size: 0.9rem; }
#checkout-box textarea.checkout-input { resize: vertical; font-family: inherit; }
.doc-row { display: flex; gap: 0.5rem; }
.doc-row .doc-tipo { width: 4.5rem; flex: none; background: #fff; }
.checkout-hint { font-size: 0.82rem; color: #666; margin: 0.6rem 0 0; }

/* v7: confirmación por correo */
.btn-send {
    width: 100%;
    box-sizing: border-box;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.95rem 1.5rem;
    border-radius: 5px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
}
.btn-send:hover { background: #3a2b1f; }
.btn-send.loading { opacity: 0.6; cursor: wait; }
.order-done-icon { font-size: 2.5rem; line-height: 1; margin-bottom: 0.5rem; }
.order-done p { margin: 0.5rem 0; }
.order-done-small { font-size: 0.85rem; color: #666; }
.order-done .btn-new-order { margin-top: 1rem; }
