:root {
    --orange-700: #e25b00;
    --orange-600: #ff6a00;
    --orange-500: #ff7a1a;
    --orange-400: #ff8a3d;
    --orange-100: #ffe5d1;
    --bg: #fff9f5;
    --text: #2a2a2a;
    --muted: #6b6b6b;
    --white: #ffffff;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    --radius: 14px;
    --radius-sm: 10px;
    --maxw: 1100px;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

/* Header */
header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.65));
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.nav {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    letter-spacing: 0.2px;
}

.brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
    display: block;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
}

nav a {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

nav a.active,
nav a:hover {
    background: var(--orange-100);
    color: var(--orange-700);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 4px;
    width: 40px;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background: var(--orange-700);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Hero */
.hero {
    background: radial-gradient(1200px 400px at 50% -10%, #ffe9da, transparent 60%),
        linear-gradient(180deg, #fff, #fff7f0);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.hero-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 48px 20px 32px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 28px;
}

.hero h1 {
    margin: 0 0 10px;
    font-size: clamp(28px, 4.3vw, 46px);
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.hero p {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 1.05rem;
}

.cta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, var(--orange-500), var(--orange-600));
    color: var(--white);
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 122, 26, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn.secondary {
    background: var(--white);
    color: var(--orange-700);
    border: 1px solid var(--orange-100);
}

.btn.secondary:hover {
    background: var(--orange-100);
    box-shadow: var(--shadow);
}

.card {
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
}

/* Sections */
main {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 28px 20px 80px;
}

section {
    display: none;
}

section.active {
    display: block;
}

.section-head {
    margin: 8px 0 20px;
}

.section-head h2 {
    margin: 0;
    font-size: clamp(22px, 3vw, 34px);
}

.section-head p {
    margin: 6px 0 0;
    color: var(--muted);
}

/* Catálogo */
.grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
}

.product {
    grid-column: span 12;
}

/* Estilos para imágenes de productos en el catálogo */
.product img.media {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    background: #f5f5f5;
}

.product h3 {
    margin: 12px 0 4px;
    font-size: 1.05rem;
}

.price {
    color: var(--orange-700);
    font-weight: 800;
    font-size: 1.1rem;
    margin: 8px 0 12px;
}

.meta {
    color: var(--muted);
    font-size: 0.92rem;
}

.price {
    color: var(--orange-700);
    font-weight: 800;
    font-size: 1.1rem;
    margin: 8px 0 12px;
    /* Aquí le estamos dando 12px de margen inferior */
}

/* 🚀 CORRECCIÓN DE BOTONES DESBORDADOS */
/* -------------------------------------- */
/* 1. Asegura que los botones flexibles puedan reducir su tamaño */
.product .btn {
    flex-shrink: 1;
    /* Permite que los botones se encojan si es necesario */
    flex-basis: auto;
    /* Les da un tamaño base inicial más pequeño */
    min-width: 0;
    /* Asegura que el texto no fuerce el ancho del botón a salirse */
}

/* 2. Asegura que el div contenedor de los botones siempre ocupe el 100% de la tarjeta */
.product>div[style] {
    width: 100%;
}

/* ... el resto de tu CSS (responsive, etc.) permanece igual ... */

/* Nosotros */
.about {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 20px;
    align-items: center;
}

.about .figure {
    border-radius: var(--radius);
    overflow: hidden;
    background: linear-gradient(135deg, #ffefe4, #ffd6b8);
    aspect-ratio: 16/11;
    position: relative;
    box-shadow: var(--shadow);
}

.about .figure::after {
    content: "Revesko";
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(255, 122, 26, 0.9);
    color: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
}

.about ul {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
}

.about li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
}

.about li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--orange-700);
    font-weight: 700;
}

/* Contacto */
form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.full {
    grid-column: 1 / -1;
}

label {
    font-weight: 700;
    font-size: 0.92rem;
    display: block;
    margin-bottom: 4px;
}

input,
textarea,
select {
    width: 100%;
    padding: 12px 12px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #fff;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--orange-500);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.toast {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--orange-600);
    color: #fff;
    border-radius: 999px;
    padding: 10px 16px;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease, transform .3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-6px);
}

/* Footer */
footer {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: #fff;
    color: var(--muted);
}

.footer-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

/* Chatbot */
.chatbot-button {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--orange-500), var(--orange-600));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    border: 0;
    cursor: pointer;
    z-index: 200;
}

.chatbot-panel {
    position: fixed;
    right: 20px;
    bottom: 84px;
    width: min(360px, 92vw);
    max-height: 70vh;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    box-shadow: var(--shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 200;
}

.chatbot-panel.open {
    display: flex;
}

.chat-header {
    padding: 10px 12px;
    background: var(--orange-100);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.chat-body {
    padding: 12px;
    overflow: auto;
    display: grid;
    gap: 8px;
}

.msg {
    padding: 8px 10px;
    border-radius: 10px;
    max-width: 85%;
}

.msg.bot {
    background: #f6f6f6;
    align-self: start;
}

.msg.user {
    background: var(--orange-100);
    align-self: end;
}

.chat-input {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.chat-input input {
    flex: 1;
}

/* Responsive */
@media (max-width: 920px) {

    .hero-inner,
    .about {
        grid-template-columns: 1fr;
    }

    .grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .product {
        grid-column: span 6;
    }
}

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

    nav ul {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 12px 20px;
        box-shadow: var(--shadow);
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s ease;
        z-index: 100;
    }

    nav ul.mobile-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    nav a {
        width: 100%;
        padding: 14px 16px;
        border-radius: 8px;
    }

    .hero-inner {
        padding-top: 28px;
    }

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

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

    .product {
        grid-column: span 12;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .hero h1 {
        font-size: 24px;
    }
}

/* Carrusel de productos en catálogo */
.product-carousel {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 4/3;
    margin-bottom: 12px;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    color: var(--orange-700);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.carousel-btn:hover {
    background: var(--white);
}

.carousel-prev {
    left: 8px;
}

.carousel-next {
    right: 8px;
}

.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    padding: 0;
}

.carousel-dot.active {
    background: var(--white);
    transform: scale(1.2);
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* Página de detalle de producto */
.product-detail {
    max-width: 1200px;
    margin: 0 auto;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.product-detail-images {
    position: sticky;
    top: 100px;
}

.product-detail-carousel {
    position: relative;
}

.detail-carousel-container {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--white);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.detail-carousel-track {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
}

.detail-carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.detail-carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.detail-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.detail-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    color: var(--orange-700);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.detail-carousel-btn:hover {
    background: var(--white);
    transform: translateY(-50%) scale(1.1);
}

.detail-carousel-prev {
    left: 16px;
}

.detail-carousel-next {
    right: 16px;
}

.detail-carousel-thumbnails {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid transparent;
    background: var(--white);
    cursor: pointer;
    padding: 0;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.detail-thumbnail:hover {
    transform: scale(1.05);
}

.detail-thumbnail.active {
    border-color: var(--orange-600);
}

.detail-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-detail-info {
    padding: 0 8px;
}

.product-specifications {
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-top: 24px;
}

.specs-grid {
    display: grid;
    gap: 12px;
}

.spec-item {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

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

.spec-key {
    color: var(--muted);
    font-size: 0.92rem;
}

.spec-value {
    color: var(--text);
    font-weight: 600;
}

.back-link:hover {
    color: var(--orange-700);
}

/* Responsive para detalle de producto */
@media (max-width: 920px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
    }

    .product-detail-images {
        position: static;
    }

    .spec-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

@media (max-width: 640px) {
    .detail-carousel-thumbnails {
        justify-content: center;
    }

    .detail-thumbnail {
        width: 60px;
        height: 60px;
    }

    .carousel-btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .carousel-prev {
        left: 4px;
    }

    .carousel-next {
        right: 4px;
    }
}