/* Estilos globales */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #0d1b2a;
    color: #f4f4f4;
    line-height: 1.6;
}

a {
    color: #ffb74d;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #010a17;
    padding: 10px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    /* Permitir que el menú de sugerencias del buscador se desborde del navbar */
    overflow: visible;
}

/* Botón hamburguesa oculto por defecto */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #ffb74d;
    font-size: 1.5rem;
    cursor: pointer;
}

.nav-left .brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffb74d;
}

.nav-menu {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
}

.nav-menu li {
    margin: 0 10px;
}

.nav-menu a {
    color: #f4f4f4;
    font-size: 0.9rem;
    padding: 5px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.nav-menu a:hover {
    background-color: #132a47;
}

.cart-button {
    background: none;
    border: none;
    color: #ffb74d;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
}

#cart-count {
    background-color: #e53935;
    color: #fff;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75rem;
    margin-left: 4px;
}

/* Hero */
.hero-section {
    position: relative;
    width: 100%;
    height: 60vh;
    overflow: hidden;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.55);
}

.hero-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.hero-overlay h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #fff;
}

.hero-overlay p {
    font-size: 1.2rem;
    color: #e0e0e0;
}

/* Sections */
.section {
    padding: 50px 20px;
    max-width: 1200px;
    margin: auto;
}

.section h2 {
    margin-bottom: 20px;
    font-size: 1.8rem;
    color: #ffb74d;
    text-align: center;
}

.section-description {
    text-align: center;
    margin-bottom: 30px;
    color: #c0c0c0;
}

/* Product grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.product-card {
    background-color: #112240;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.product-card img {
    width: 100%;
    max-height: 160px;
    object-fit: contain;
    margin-bottom: 15px;
}

.product-card h3 {
    margin-bottom: 10px;
    color: #ffb74d;
}

.product-card p {
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: #cfd8dc;
}

.card-actions {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.btn {
    cursor: pointer;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.9rem;
    text-align: center;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn.primary {
    background-color: #1976d2;
    color: #fff;
}

.btn.primary:hover {
    background-color: #1565c0;
}

.btn.secondary {
    background-color: #ffb74d;
    color: #000;
}

.btn.secondary:hover {
    background-color: #ffa726;
}

.btn.order {
    background-color: #43a047;
    color: #fff;
}

.btn.order:hover {
    background-color: #2e7d32;
}

/* Buscador de productos */
.search-input {
    padding: 6px 10px;
    border-radius: 4px;
    border: none;
    font-size: 0.9rem;
    width: 180px;
}

/* Contenedor del buscador con icono */
.search-wrapper {
    position: relative;
    display: inline-block;
    margin-right: 10px;
}

.search-icon {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    color: #808ba1;
    pointer-events: none;
}

/* Lista de resultados del buscador */
.search-results {
    position: absolute;
    top: 110%;
    left: 0;
    right: 0;
    background-color: #112240;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    z-index: 1500;
    max-height: 200px;
    overflow-y: auto;
}

.search-results ul {
    list-style: none;
}

.search-results li {
    padding: 8px 10px;
    font-size: 0.85rem;
    color: #cfd8dc;
    cursor: pointer;
}

.search-results li:hover {
    background-color: #1e3a5f;
}

.search-results .no-result {
    padding: 8px 10px;
    color: #b0bec5;
}

/* Enlace de marca dentro de la descripción de producto */
.brand-link {
    color: #ffb74d;
    font-weight: bold;
    text-decoration: underline;
    cursor: pointer;
}

/* Wheel */
.wheel-wrapper {
    position: relative;
    width: 260px;
    height: 260px;
    margin: 20px auto;
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 8px solid #010a17;
    /* Ocho segmentos con colores relacionados a la marca */
    background: conic-gradient(
      #ffb74d 0deg 45deg,
      #1976d2 45deg 90deg,
      #ef6c00 90deg 135deg,
      #43a047 135deg 180deg,
      #ab47bc 180deg 225deg,
      #f06292 225deg 270deg,
      #26c6da 270deg 315deg,
      #6d4c41 315deg 360deg
    );
    transition: transform 4s ease-out;
}

/* Logo central de la ruleta */
.wheel-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #010a17;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: bold;
    color: #ffb74d;
    box-shadow: 0 0 8px rgba(0,0,0,0.4);
    z-index: 2;
}

/* Etiquetas de segmentos */
.segment-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: center;
    font-size: 0.7rem;
    font-weight: bold;
    color: #fff;
    pointer-events: none;
}

.arrow {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 20px solid #ffb74d;
}

.discount-result {
    margin-top: 20px;
    text-align: center;
    color: #fff;
}

/* Ayuda experto */
.expert-help {
    margin-top: 20px;
    text-align: center;
    color: #cfd8dc;
}

.expert-help p {
    margin-bottom: 10px;
}

.hidden {
    display: none;
}

/* Recipes */
.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.recipe-card {
    background-color: #112240;
    border-radius: 8px;
    padding: 20px;
    color: #cfd8dc;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.recipe-card h3 {
    color: #ffb74d;
    margin-bottom: 10px;
}

.recipe-card p {
    margin-bottom: 10px;
    font-size: 0.9rem;
}

/* FAQ */
.faq-item {
    background-color: #112240;
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.faq-item h3 {
    color: #ffb74d;
    margin-bottom: 8px;
}

.faq-item p {
    color: #cfd8dc;
    font-size: 0.9rem;
}

/* Test */
.test-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background-color: #112240;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.question p {
    margin-bottom: 10px;
    color: #ffb74d;
    font-weight: bold;
}

.question label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: #cfd8dc;
}

.recommendation-result {
    margin-top: 20px;
    text-align: center;
    color: #fff;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cuando el modal tiene la clase hidden, se oculta por completo */
.modal.hidden {
    display: none;
}

.modal-content {
    background-color: #112240;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    color: #cfd8dc;
}

#cart-items {
    list-style: none;
    margin-bottom: 20px;
}

#cart-items li {
    padding: 6px 0;
    border-bottom: 1px solid #1e3a5f;
}

/* Footer */
.footer {
    background-color: #010a17;
    color: #cfd8dc;
    padding: 20px;
    text-align: center;
}
.footer p {
    margin-bottom: 8px;
}

/* Responsive adjustments for mobile */
@media (max-width: 600px) {
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    .nav-menu li {
        margin: 5px;
    }
    .hero-section {
        height: 40vh;
    }
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    .wheel-wrapper {
        width: 200px;
        height: 200px;
    }
    .wheel-logo {
        width: 60px;
        height: 60px;
        font-size: 1rem;
    }
    .search-input {
        width: 140px;
    }
}

/* Ajustes adicionales para tablets (≤768px) */
@media (max-width: 768px) {
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    .nav-menu li {
        margin: 6px;
    }
    .hero-overlay h1 {
        font-size: 2rem;
    }
    .hero-overlay p {
        font-size: 1rem;
    }
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
    .wheel-wrapper {
        width: 220px;
        height: 220px;
    }
    .wheel-logo {
        width: 65px;
        height: 65px;
        font-size: 1.1rem;
    }
    .search-input {
        width: 160px;
    }
    /* Mostrar botón de menú y ocultar menú inicial en pantallas pequeñas */
    .menu-toggle {
        display: block;
    }
    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        background-color: #010a17;
        margin-top: 10px;
    }
    .nav-menu.show {
        display: flex;
    }
    .nav-menu li {
        width: 100%;
        text-align: center;
        margin: 5px 0;
    }
}

/* Ajustes específicos para móviles pequeños (≤480px) */
@media (max-width: 480px) {
    .nav-menu {
        flex-direction: column;
        align-items: center;
    }
    .nav-menu li {
        margin: 4px 0;
    }
    .hero-section {
        height: 45vh;
    }
    .hero-overlay h1 {
        font-size: 1.6rem;
    }
    .hero-overlay p {
        font-size: 0.9rem;
    }
    .product-grid {
        grid-template-columns: 1fr;
    }
    .wheel-wrapper {
        width: 180px;
        height: 180px;
    }
    .wheel-logo {
        width: 50px;
        height: 50px;
        font-size: 0.9rem;
    }
    .search-input {
        width: 120px;
    }
}