/* ======================================
   MAIN.CSS - Estilos Globales
   Carga en todas las páginas
   ====================================== */

:root {
    --tierra: #2A241C;
    --cal: #F6F2EA;
    --arena: #E6DDCB;
    --henequen: #A8813C;
    --agave: #4E5A48;
    --humo: #857C6D;
    --cobre: #B87333;
    --terracota: #C85A38;
    --verde-natural: #5A7F6E;
    --gris-lujo: #4A4A4A;
    --blanco-puro: #FFFFFF;
    --negro-suave: #1A1A1A;
    --accent-rosa: #D4A8A0;

    --hover: rgba(168, 129, 60, 0.2);
    --focus: rgba(168, 129, 60, 0.4);
    --shadow-light: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-medium: 0 8px 16px rgba(0,0,0,0.12);
    --shadow-premium: 0 12px 32px rgba(0,0,0,0.15);

    --display: 'Cormorant Garamond', Georgia, serif;
    --body: 'Jost', system-ui, sans-serif;

    --max: 1200px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16.5px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--body);
    font-weight: 300;
    line-height: 1.7;
    color: var(--tierra);
    background: var(--cal);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Tipografía */
h1, h2, h3, h4 {
    font-family: var(--display);
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: -0.01em;
}

h1 { font-size: clamp(40px, 5.6vw, 70px); }
h2 { font-size: clamp(32px, 4.4vw, 50px); margin-top: 2rem; margin-bottom: 1rem; }
h3 { font-size: clamp(22px, 4vw, 28px); }

.eyebrow {
    font-size: 11.5px;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--henequen);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Layout */
.container, .wrap {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.wrap {
    padding: 0 26px;
}

section {
    padding: 60px 0;
}

/* Header */
.site-header, header {
    background: var(--cal);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
    transition: var(--transition);
}

.site-header.scrolled {
    box-shadow: var(--shadow-light);
    backdrop-filter: blur(8px);
    background: rgba(246, 242, 234, 0.98);
}

header {
    z-index: 60;
    background: rgba(246, 242, 234, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(42, 36, 28, 0.1);
    padding: 0;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 74px;
    gap: 20px;
    width: 100%;
    padding: 0 26px;
}

.logo {
    font-family: var(--display);
    font-size: 20px;
    font-weight: 500;
    color: var(--tierra);
    text-decoration: none;
}

.main-nav, nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
}

nav ul {
    gap: 30px;
}

.main-nav a, nav a {
    text-decoration: none;
    font-size: 13.5px;
    letter-spacing: 0.05em;
    color: var(--tierra);
    transition: color 0.2s;
}

.main-nav a:hover, nav a:hover {
    color: var(--henequen);
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 14px;
    padding: 1rem 0;
    color: var(--humo);
}

.breadcrumbs a {
    color: var(--henequen);
    text-decoration: none;
}

/* Botones */
.btn {
    display: inline-block;
    padding: 16px 40px;
    font-size: 12.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 500;
    text-decoration: none;
    border: 2px solid var(--tierra);
    background: var(--tierra);
    color: var(--cal);
    transition: var(--transition);
    cursor: pointer;
    font-family: var(--body);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    background: var(--cobre);
    border-color: var(--cobre);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(184, 115, 51, 0.3);
}

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

.btn-solid {
    background: var(--tierra);
    color: var(--cal);
}

.btn-solid:hover {
    background: var(--henequen);
    border-color: var(--henequen);
}

.btn-ghost {
    background: transparent;
    color: var(--tierra);
    border-color: var(--tierra);
}

.btn-ghost:hover {
    background: var(--tierra);
    color: var(--cal);
}

/* Formularios */
form {
    margin: 20px 0;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 12px;
    margin: 8px 0 16px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: var(--body);
    font-size: 14px;
    transition: var(--transition);
    background: white;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--cobre);
    box-shadow: 0 0 0 3px rgba(184, 115, 51, 0.1);
}

input.error,
textarea.error,
select.error {
    border-color: #E74C3C;
    background-color: rgba(231, 76, 60, 0.05);
}

input.error:focus,
textarea.error:focus,
select.error:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

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

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

button[type="submit"] {
    background: var(--tierra);
    color: var(--cal);
    padding: 16px 40px;
    border: none;
    border-radius: 4px;
    font-size: 12.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--body);
}

button[type="submit"]:hover:not(:disabled) {
    background: var(--cobre);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(184, 115, 51, 0.3);
}

button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Footer */
.site-footer {
    background: var(--tierra);
    color: var(--cal);
    padding: 3rem 0 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 4rem;
}

.site-footer .container, .site-footer .wrap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.site-footer h3 {
    font-size: 14px;
    font-family: var(--body);
    font-weight: 500;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.site-footer ul {
    list-style: none;
}

.site-footer a {
    color: var(--cal);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s;
    font-size: 13px;
    display: block;
    margin-bottom: 8px;
}

.site-footer a:hover {
    opacity: 1;
}

.site-footer .footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1rem;
    font-size: 12px;
    opacity: 0.7;
}

/* WhatsApp */
.whatsapp-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(37,211,102,0.4);
    z-index: 999;
    transition: all 0.3s ease;
    animation: float 3s ease-in-out infinite;
}

.whatsapp-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.6);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* FAQ */
.faq, .faq-grid {
    margin: 3rem 0;
}

.faq details, .faq-item {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.faq-item {
    border-top: 1px solid #E6DDCB;
    padding: 20px 0;
}

.faq summary, .faq-q {
    font-weight: 500;
    font-size: 16px;
    outline: none;
    user-select: none;
}

.faq summary::marker {
    content: '';
}

.faq details[open] summary::before {
    content: '−  ';
}

.faq details:not([open]) summary::before {
    content: '+  ';
}

.faq summary::before {
    color: var(--henequen);
    font-weight: 600;
}

.faq-q {
    color: var(--tierra);
    padding: 8px 0;
}

.faq-q:hover {
    color: var(--cobre);
    transition: var(--transition);
}

.faq details > *:not(summary) {
    animation: slideDown 0.3s ease-out;
    margin-top: 1rem;
    color: var(--humo);
}

.faq-a {
    margin-top: 12px;
    color: var(--humo);
    display: none;
    font-size: 14px;
    line-height: 1.6;
}

.faq-item.open .faq-a {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tablas */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

th, td {
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    text-align: left;
}

th {
    background: var(--arena);
    font-weight: 500;
}

tr:hover {
    background: var(--cal);
}

/* Imágenes */
.image-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.image-wrapper img {
    display: block;
    width: 100%;
    height: auto;
}

/* Componentes reutilizables */
.fiber-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1px;
    background: var(--tierra);
    padding: 1px;
    margin: 2rem 0;
}

.fiber-card {
    background: var(--cal);
    padding: 2rem 1.5rem;
    text-align: center;
}

.fiber-card h3 {
    font-size: 20px;
    margin-bottom: 0.5rem;
}

.fiber-card p {
    font-size: 14px;
    color: var(--humo);
    margin-bottom: 1rem;
}

.fiber-tag {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 8px;
    background: var(--agave);
    color: var(--cal);
}

.dual-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid var(--tierra);
    margin: 3rem 0;
    min-height: 300px;
}

.dual-panel > div {
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: background 0.3s ease;
}

.dual-panel > div:first-child {
    border-right: 1px solid var(--tierra);
}

.dual-panel > div:hover {
    background: var(--arena);
}

.dual-panel h3 {
    font-size: 24px;
    margin-bottom: 1rem;
}

.dual-panel p {
    color: var(--humo);
    margin-bottom: 1.5rem;
}

.stats, .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
    text-align: center;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.stat {
    padding: 2rem;
}

.stat-number {
    font-family: var(--display);
    font-size: 48px;
    color: var(--henequen);
    font-weight: 500;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: var(--humo);
    margin-top: 0.5rem;
}

.benefits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    background: var(--arena);
    padding: 3rem;
    margin: 3rem 0;
}

.benefit {
    padding: 1rem;
}

.benefit h3 {
    font-size: 18px;
    margin-bottom: 1rem;
}

.benefit p {
    color: var(--humo);
    font-size: 14px;
}

.process {
    margin: 3rem 0;
}

.process ol {
    list-style: none;
    counter-reset: step-counter;
}

.process li {
    counter-increment: step-counter;
    margin-bottom: 2rem;
    padding-left: 80px;
    position: relative;
    min-height: 60px;
}

.process li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    font-family: var(--display);
    font-size: 36px;
    color: var(--henequen);
    font-weight: 400;
    line-height: 1;
}

.cities {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 2rem 0;
}

.city-chip {
    padding: 10px 20px;
    border: 1px solid var(--tierra);
    background: transparent;
    color: var(--tierra);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-family: var(--body);
}

.city-chip:hover {
    background: var(--tierra);
    color: var(--cal);
}

/* Responsive */
@media (max-width: 1020px) {
    .dual-panel {
        grid-template-columns: 1fr;
    }

    .dual-panel > div:first-child {
        border-right: none;
        border-bottom: 1px solid var(--tierra);
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
    }

    .dual-panel,
    .stats,
    .benefits,
    .fiber-grid {
        grid-template-columns: 1fr;
    }

    .process li {
        padding-left: 50px;
    }

    .process li::before {
        font-size: 24px;
    }

    .site-footer .container,
    .site-footer .wrap {
        grid-template-columns: 1fr;
    }

    .whatsapp-button {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }
}

@media (max-width: 560px) {
    .btn {
        width: 100%;
        text-align: center;
    }

    h1 {
        font-size: 32px;
    }

    h2 {
        font-size: 24px;
    }

    .container, .wrap {
        padding: 0 1rem;
    }

    .whatsapp-button {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
    }
}

/* ======================================
   HOMEPAGE STYLES
   ====================================== */

main {
    min-height: calc(100vh - 80px - 200px);
    padding: 4rem 0;
}

.hero {
    background: linear-gradient(135deg, rgba(168, 129, 60, 0.05) 0%, rgba(230, 221, 203, 0.2) 100%);
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    max-width: 90%;
    margin: 0 auto 20px;
}

.hero-sub {
    font-size: 18px;
    color: var(--humo);
    max-width: 70ch;
    margin: 0 auto 30px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin: 40px 0;
}

.card {
    border: 1px solid #E6DDCB;
    padding: 24px;
    transition: var(--transition);
    background: var(--cal);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--cobre) 0%, var(--terracota) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: inherit;
}

.card:hover {
    box-shadow: var(--shadow-premium);
    transform: translateY(-4px);
    border-color: var(--cobre);
}

.card:hover::before {
    opacity: 0.05;
}

.card h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--tierra);
    position: relative;
    z-index: 1;
}

.card p {
    font-size: 14px;
    color: var(--humo);
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.card a {
    color: var(--cobre);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    position: relative;
    z-index: 1;
    display: inline-block;
    transition: var(--transition);
}

.card a:hover {
    color: var(--terracota);
    transform: translateX(4px);
}

.cta-section {
    background: var(--arena);
    padding: 60px;
    text-align: center;
    margin: 60px -1.5rem 0;
}

.cta-section h2 {
    margin: 0 0 20px;
}

.cta-section p {
    margin: 16px auto 24px;
    max-width: 62ch;
}

/* ======================================
   PRODUCT SHEET STYLES
   ====================================== */

.product-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 40px 0;
    align-items: start;
}

.product-image {
    width: 100%;
    aspect-ratio: 1;
    background: repeating-linear-gradient(
        45deg,
        #E6DDCB 0,
        #E6DDCB 2px,
        #D4C4B0 2px,
        #D4C4B0 4px
    );
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--humo);
}

.product-details h1 {
    margin-bottom: 12px;
}

.product-meta {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    font-size: 14px;
}

.product-meta span {
    color: var(--humo);
}

.product-price {
    font-size: 32px;
    color: var(--henequen);
    font-weight: 500;
    margin: 30px 0;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    background: var(--arena);
    padding: 30px;
    margin: 30px 0;
    border-left: 4px solid var(--henequen);
}

.spec-item h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.spec-item p {
    font-size: 14px;
    color: var(--humo);
}

.cta-group {
    display: flex;
    gap: 12px;
    margin: 30px 0;
}

.cta-group a {
    flex: 1;
    text-align: center;
    padding: 15px;
}

.related-products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.related-card {
    border: 1px solid #E6DDCB;
    padding: 16px;
    text-align: center;
    text-decoration: none;
    color: inherit;
}

.related-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.related-name {
    font-weight: 500;
    margin-bottom: 8px;
}

.related-price {
    color: var(--henequen);
    font-weight: 500;
    margin-bottom: 12px;
}

/* Product responsive */
@media (max-width: 768px) {
    .product-header {
        grid-template-columns: 1fr;
    }

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

    .cta-group {
        flex-direction: column;
    }

    .cta-section {
        margin: 60px -1.5rem 0;
        padding: 40px 1.5rem;
    }
}
