:root {
    --purple: #7C3AED;
    --purple-light: #8B5CF6;
    --purple-dark: #6D28D9;
    --purple-soft: #F3E8FF;
    --bg-gray: #FAFAFC;
    --text: #1F2937;
    --muted: #6B7280;
    --border: #E5E7EB;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    background: #fff;
    color: var(--text);
    display: flex;
    flex-direction: column;
}

button, input, textarea, select { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

a { color: inherit; text-decoration: none; }

button { border: 0; cursor: pointer; }

/*|| SECCION NAVBAR ||*/

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #F3F4F6;
}

.header-inner {
    width: 100%;
    max-width: 1280px;
    height: 80px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo { display: flex; align-items: center; }

.logo-button {
    display: flex;
    align-items: center;
    outline: none;
}

.logo-button img {
    width: 250px;
    height: 90px;
    object-fit: contain;
    display: block;
}

.logo-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: var(--purple);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 10px rgba(124,58,237,.2);
    transition: transform .2s ease;
}

.logo-button:hover .logo-mark { transform: scale(1.05); }
.logo-mark svg { width: 32px; height: 32px; fill: currentColor; }

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 32px;
    font-size: 14px;
    font-weight: 500;
}

.desktop-nav a, .mobile-nav a {
    color: #4B5563;
    transition: color .2s ease;
}

.desktop-nav a:hover, .mobile-nav a:hover,
.desktop-nav a.active, .mobile-nav a.active {
    color: var(--purple);
}

.desktop-nav a.active, .mobile-nav a.active { font-weight: 600; }

.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-box { position: relative; }

.search-box input {
    width: 240px;
    padding: 8px 16px 8px 36px;
    font-size: 14px;
    background: #F3F4F6;
    border: 1px solid transparent;
    border-radius: 999px;
    outline: none;
    transition: .2s ease;
}

.search-box input:focus {
    background: #fff;
    border-color: var(--purple);
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    font-size: 12px;
}

.cart-button {
    position: relative;
    padding: 10px;
    border-radius: 999px;
    background: #F5F3FF;
    color: var(--purple);
    transition: .2s ease;
}

.cart-button:hover { background: var(--purple); color: #fff; }

#cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #EF4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav {
    display: none;
    justify-content: space-around;
    padding: 8px 0;
    border-top: 1px solid #F3F4F6;
    background: #F9FAFB;
    font-size: 12px;
    font-weight: 600;
}

.mobile-nav a { padding: 4px 12px; }

.page-main { flex: 1; }

.content-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding-left: 32px;
    padding-right: 32px;
}

/* || BUSQUEDA || */

/* Submenú desplegable de búsqueda */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    min-width: 280px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-height: 320px;
    overflow-y: auto;
    z-index: 100;
    display: none; /* Se muestra dinámicamente con JS */
}

.search-results-dropdown.active {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #F3F4F6;
    transition: background 0.2s ease;
}

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

.search-result-item:hover {
    background: #F9FAFB;
}

/* Imagen a la izquierda */
.search-result-item img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
    background: #F3F4F6;
    flex-shrink: 0;
}

/* Nombre arriba y Precio abajo */
.search-result-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.search-result-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-price {
    font-size: 12px;
    font-weight: 700;
    color: var(--purple);
    margin-top: 2px;
}

.search-no-results {
    padding: 12px;
    font-size: 13px;
    color: var(--muted);
    text-align: center;
}

/* || SECCION HERO || */

.page-view { transition: opacity .25s ease-in-out; }

.hero {
    background-color: var(--purple);
    background-image: radial-gradient(rgba(255,255,255,.15) 1px, transparent 0);
    background-size: 24px 24px;
    color: #fff;
    padding: 80px 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 896px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-logo {
    background: transparent;
    background-color: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .3s ease;
}

.hero-logo img {
    display: block;
    width: 600px;
    height: auto;
    object-fit: contain;
    background: transparent;
    border: none;
    box-shadow: none;
}

@media (max-width: 480px) {
    .hero-logo,
    .hero-logo img {
        max-width: 400px;
    }
}

.hero-logo:hover { transform: scale(1.05); }
.hero-logo svg { width: 64px; height: 64px; fill: currentColor; }

.hero h1 {
    margin: 0 0 16px;
    font-size: 48px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -.025em;
}

.hero p {
    max-width: 672px;
    margin: 0 0 32px;
    font-size: 20px;
    line-height: 1.5;
    font-weight: 300;
    color: #EDE9FE;
}

.hero-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    border-radius: 999px;
    background: #fff;
    color: var(--purple);
    font-weight: 700;
    box-shadow: 0 10px 15px rgba(0,0,0,.12);
    transition: background .2s ease;
}

.hero-button:hover { background: #F5F3FF; }

/* || SECCION DE PRODUCTOS DESTACADOS ||*/

.featured-section { padding-top: 64px; padding-bottom: 64px; }

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 32px;
}

.section-heading h2 {
    margin: 0;
    color: #111827;
    font-size: 24px;
    font-weight: 700;
}

.section-heading p {
    margin: 4px 0 0;
    color: #6B7280;
    font-size: 14px;
}

.view-all {
    color: var(--purple);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    gap: 4px;
    align-items: center;
}

.view-all:hover { text-decoration: underline; }

.featured-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.product-card {
    background: #fff;
    border: 4px solid transparent;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all .3s ease;
}

.product-card:hover {
    border-color: var(--purple);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -10px rgba(124,58,237,.15);
}

.product-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    background: #F9FAFB;
    margin-bottom: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.product-tag {
    display: inline-block;
    color: var(--purple);
    background: #F5F3FF;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.product-card h3 {
    margin: 8px 0 0;
    color: #111827;
    font-size: 16px;
    font-weight: 700;
}

.product-card-description {
    margin: 4px 0 0;
    color: #6B7280;
    font-size: 12px;
    line-height: 1.5;
}

.product-card-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-card-price {
    color: #111827;
    font-size: 18px;
    font-weight: 800;
}

.product-card-link {
    color: var(--purple);
    font-size: 12px;
    font-weight: 600;
}

/*|| SECCION DE CONTACTO EN HOME ||*/

.home-contact {
    padding: 64px 16px;
    background: #F5F3FF;
    border-top: 1px solid #EDE9FE;
}

.home-contact-inner {
    max-width: 768px;
    margin: 0 auto;
    text-align: center;
}

.home-contact h2 {
    margin: 0 0 8px;
    font-size: 24px;
    color: #111827;
}

.home-contact p {
    margin: 0 0 32px;
    color: #4B5563;
    font-size: 14px;
}

.home-contact-form {
    padding: 24px;
    background: #fff;
    border: 1px solid #EDE9FE;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.home-contact-form input,
.home-contact-form textarea,
.contact-form input,
.contact-form select {
    width: 100%;
    border: 1px solid #E5E7EB;
    background: #F9FAFB;
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color .2s ease;
}

.home-contact-form textarea { resize: vertical; margin-top: 16px; }

.home-contact-form input:focus,
.home-contact-form textarea:focus,
.contact-form input:focus,
.contact-form select:focus { border-color: var(--purple); }

.home-contact-form button,
.contact-form button {
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    border-radius: 12px;
    background: var(--purple);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    transition: background .2s ease;
}

.home-contact-form button:hover,
.contact-form button:hover { background: var(--purple-dark); }

/*|| SECCION FOOTER ||*/

.site-footer {
    margin-top: auto;
    padding: 48px 0 32px;
    background: #111827;
    color: #D1D5DB;
    border-top: 1px solid #1F2937;
}

.footer-inner { max-width: 1280px; margin: 0 auto; padding: 0 32px; }

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid #1F2937;
}

.footer-brand-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

.footer-brand p { color: #9CA3AF; font-size: 12px; line-height: 1.6; margin: 12px 0 0; }

.site-footer h4 {
    margin: 0 0 12px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; font-size: 12px; }
.site-footer a { transition: color .2s ease; }
.site-footer a:hover { color: var(--purple-light); }

.payment-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    color: #9CA3AF;
    font-size: 24px;
}

.site-footer .payment-icons + p { margin: 0; color: #6B7280; font-size: 11px; }

.footer-bottom {
    padding-top: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #6B7280;
    font-size: 12px;
}

.footer-bottom p { margin: 0; }
.footer-bottom div { display: flex; gap: 16px; }

/*|| SECCION DE CARRO DE COMPRAS ||*/

.cart-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0,0,0,.4);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease;
}

.cart-backdrop.open { opacity: 1; visibility: visible; }

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 51;
    width: 100%;
    max-width: 448px;
    height: 100%;
    background: #fff;
    box-shadow: -10px 0 30px rgba(0,0,0,.15);
    transform: translateX(100%);
    transition: transform .3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.cart-drawer.open { transform: translateX(0); }

.cart-header {
    padding: 20px;
    border-bottom: 1px solid #F3F4F6;
    background: #F5F3FF;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-title { display: flex; align-items: center; gap: 8px; }
.cart-title i { color: var(--purple); font-size: 20px; }
.cart-title h3 { margin: 0; color: #111827; font-size: 18px; }
.cart-header button { padding: 8px; color: #9CA3AF; background: transparent; border-radius: 50%; }
.cart-header button:hover { color: #4B5563; }

.cart-items { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }

.cart-empty {
    height: 100%;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9CA3AF;
    text-align: center;
    gap: 12px;
}

.cart-empty i { color: #DDD6FE; font-size: 36px; }

.cart-item {
    padding: 12px;
    background: #F9FAFB;
    border: 1px solid #F3F4F6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-item-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cart-item img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; background: #fff; padding: 4px; }
.cart-item h4 { margin: 0; color: #111827; font-size: 12px; font-weight: 700; }
.cart-item-price { color: var(--purple); font-size: 12px; font-weight: 800; }
.cart-item-remove { padding: 8px; background: transparent; color: #9CA3AF; }
.cart-item-remove:hover { color: #EF4444; }

.cart-footer {
    padding: 20px;
    border-top: 1px solid #F3F4F6;
    background: #F9FAFB;
}

.cart-subtotal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #4B5563;
    font-size: 14px;
    font-weight: 500;
}

.cart-subtotal-row span:last-child { color: #111827; font-size: 18px; font-weight: 700; }

.cart-footer p { color: #9CA3AF; font-size: 12px; margin: 12px 0; }

.checkout-button {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    background: var(--purple);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(124,58,237,.18);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.checkout-button:hover { background: var(--purple-dark); }

/*|| SECCION RESPONSIVE ||*/

@media (max-width: 1024px) {
    .header-inner, .footer-inner, .content-container { padding-left: 24px; padding-right: 24px; }
    .featured-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .footer-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .search-box input { width: 192px; }
}

@media (max-width: 767px) {
    .header-inner { height: 72px; padding: 0 16px; }
    .desktop-nav { display: none; }
    .mobile-nav { display: flex; }
    .header-controls { gap: 10px; }
    .search-box input { width: 128px; }
    .code-button { display: none; }
    .content-container { padding-left: 16px; padding-right: 16px; }
    .hero { padding: 64px 16px; }
    .hero h1 { font-size: 32px; }
    .hero p { font-size: 18px; }
    .hero-logo { width: 96px; height: 96px; }
    .hero-logo svg { width: 56px; height: 56px; }
    .section-heading { align-items: flex-start; gap: 16px; }
    .section-heading h2 { font-size: 22px; }
    .featured-section { padding-top: 48px; padding-bottom: 48px; }
    .home-contact { padding: 48px 16px; }
    .form-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .footer-bottom div { flex-wrap: wrap; justify-content: center; }
    .cart-drawer { max-width: 100%; }
    .file-tree { width: 100%; flex-basis: 40%; border-right: 0; border-bottom: 1px solid #1F2937; }
}

@media (max-width: 480px) {
    .logo-mark { width: 44px; height: 44px; border-radius: 14px; }
    .logo-mark svg { width: 28px; height: 28px; }
    .search-box input { width: 108px; font-size: 12px; padding-left: 32px; }
    .cart-button { padding: 9px; }
    .featured-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .section-heading { flex-direction: column; align-items: flex-start; }
}

/*|| MODAL LEGAL DEL FOOTER ||*/

.legal-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(17, 24, 39, .55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.legal-modal-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.legal-modal {
    width: 100%;
    max-width: 620px;
    max-height: 85vh;
    background: #fff;
    border-radius: 24px;
    border: 1px solid #F3F4F6;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(12px);
    transition: transform .25s ease;
}

.legal-modal-backdrop.open .legal-modal {
    transform: translateY(0);
}

.legal-modal-header {
    padding: 20px 24px;
    background: #F5F3FF;
    border-bottom: 1px solid #EDE9FE;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.legal-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legal-modal-title i {
    color: var(--purple);
    font-size: 20px;
}

.legal-modal-title h3 {
    margin: 0;
    color: #111827;
    font-size: 18px;
    font-weight: 800;
}

.legal-modal-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: transparent;
    color: #6B7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, color .2s ease;
}

.legal-modal-close:hover {
    background: #EDE9FE;
    color: var(--purple);
}

.legal-modal-body {
    padding: 24px;
    overflow-y: auto;
    color: #4B5563;
    font-size: 14px;
    line-height: 1.65;
}

.legal-modal-body h4 {
    margin: 16px 0 6px;
    color: #111827;
    font-size: 15px;
    font-weight: 700;
}

.legal-modal-body h4:first-child {
    margin-top: 0;
}

.legal-modal-body p {
    margin: 0 0 12px;
}

.legal-modal-footer {
    padding: 16px 24px;
    background: #F9FAFB;
    border-top: 1px solid #F3F4F6;
    display: flex;
    justify-content: flex-end;
}

.legal-modal-accept {
    padding: 10px 22px;
    border-radius: 12px;
    background: var(--purple);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    transition: background .2s ease;
}

.legal-modal-accept:hover {
    background: var(--purple-dark);
}

/* || ADAPTACIÓN RESPONSIVE PARA BÚSQUEDA MÓVIL ||*/

@media (max-width: 767px) {
    .search-box {
        position: relative;
        flex: 1; /* Ocupa el espacio disponible en el navbar */
        max-width: 100%;
    }

    .search-box input {
        width: 100% !important;
        font-size: 14px;
        padding-left: 36px;
    }

    .search-results-dropdown {
        position: fixed;
        left: 50% !important;
        transform: translateX(-50%);
        top: 75px !important;
        width: 90vw !important;
        max-width: 400px;
        min-width: unset;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
        max-height: 60vh;
        z-index: 999;
    }

    .search-result-item {
        padding: 12px 16px;
    }

    .search-result-item img {
        width: 50px;
        height: 50px;
    }

    .search-result-name {
        font-size: 14px;
    }

    .search-result-price {
        font-size: 13px;
    }
}