/* =================================================================
   site.css — Sitio web público de RapiClean (mobile-first)
   Cubre: index, sitioweb, catalogo, pedido, registro, login,
          gracias, graciasPaypal, Resindex
   ================================================================= */

/* ─── 1. TOKENS DE DISEÑO ───────────────────────────────────────── */
:root {
    --cream: #f8f5f0;
    --white: #ffffff;
    --ink: #1a1a1a;
    --ink-soft: #4a4a4a;
    --ink-faded: #8a8a8a;
    --sky: #00aeef;
    --sky-mid: #0090c8;
    --sky-pale: #e6f6fd;
    --sky-light: #f0f9fd;
    --border: #e0dbd3;
    --border-soft: #efece6;
    --error: #dc3545;
    --success: #28a745;
    --warning: #ffa500;

    --serif: 'Cormorant Garamond', Georgia, serif;
    --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .08);
    --shadow:    0 4px 12px rgba(0, 0, 0, .08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, .12);

    --ease: cubic-bezier(.4, 0, .2, 1);
    --transition: .3s var(--ease);

    --container: 1180px;
    --header-h: 64px;
}

/* ─── 2. RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--cream);
    overflow-x: hidden;
}
img, video { max-width: 100%; height: auto; display: block; }
a  { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: transparent; }
ul, ol { list-style: none; }

/* Scrollbar */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--sky); border-radius: 3px; }

/* ─── 3. UTILIDADES BÁSICAS ─────────────────────────────────────── */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.text-center { text-align: center; }
.hidden    { display: none !important; }
.sr-only   { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
             clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ─── 4. TIPOGRAFÍA ─────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; line-height: 1.2; color: var(--ink); }
h1 { font-size: clamp(2rem, 6vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 5vw, 2.5rem); }
h3 { font-size: clamp(1.3rem, 4vw, 1.8rem); }
h4 { font-size: 1.2rem; }
p  { color: var(--ink-soft); }

.section-label {
    font-family: var(--sans);
    font-size: .75rem;
    font-weight: 500;
    letter-spacing: .25em;
    text-transform: uppercase;
    color: var(--sky-mid);
    display: inline-block;
    margin-bottom: .75rem;
}

/* ─── 5. BOTONES ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-pill);
    font-weight: 500;
    font-size: .95rem;
    transition: var(--transition);
    text-align: center;
    white-space: nowrap;
    min-height: 44px;
}
.btn-primary    { background: var(--sky); color: white; }
.btn-primary:hover, .btn-primary:focus { background: var(--sky-mid); transform: translateY(-2px); }
.btn-outline    { background: transparent; color: var(--ink); border: 1px solid var(--border); }
.btn-outline:hover, .btn-outline:focus { border-color: var(--sky); color: var(--sky); }
.btn-ghost      { background: transparent; color: var(--sky-mid); }
.btn-block      { width: 100%; }
.btn:disabled   { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ─── 6. HEADER + NAV ───────────────────────────────────────────── */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(248, 245, 240, .95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: var(--header-h);
}
.site-header .container {
    display: flex; align-items: center; justify-content: space-between; height: 100%;
}
.site-logo {
    font-family: var(--serif); font-size: 1.5rem; font-weight: 600;
    display: flex; align-items: center; gap: 8px;
}
.site-logo img { height: 32px; width: auto; }

.site-nav { display: flex; gap: 28px; align-items: center; }
.site-nav a {
    font-size: .9rem; color: var(--ink-soft); position: relative;
    transition: color var(--transition);
}
.site-nav a:hover { color: var(--sky-mid); }
.site-nav a.active { color: var(--sky); }

.nav-toggle {
    display: none; padding: 8px; font-size: 1.5rem; color: var(--ink);
}

/* Móvil — menú hamburguesa */
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .site-nav {
        position: fixed; inset: var(--header-h) 0 0 0;
        background: var(--cream); flex-direction: column;
        justify-content: flex-start; padding-top: 40px; gap: 24px;
        transform: translateX(100%); transition: transform var(--transition);
        z-index: 99;
    }
    .site-nav.open { transform: translateX(0); }
    .site-nav a { font-size: 1.2rem; }
}

/* ─── 7. SECCIONES ──────────────────────────────────────────────── */
.section { padding: 60px 0; }
.section-sm { padding: 40px 0; }
.section-lg { padding: 100px 0; }

@media (min-width: 768px) {
    .section { padding: 100px 0; }
    .section-lg { padding: 140px 0; }
}

/* ─── 8. HERO ───────────────────────────────────────────────────── */
.hero {
    min-height: calc(100vh - var(--header-h));
    display: flex; align-items: center;
    background: linear-gradient(135deg, var(--cream) 0%, var(--sky-pale) 100%);
    padding: 60px 0;
}
.hero-grid {
    display: grid; grid-template-columns: 1fr; gap: 40px; align-items: center;
}
.hero h1 { margin-bottom: 24px; }
.hero p  { font-size: 1.1rem; margin-bottom: 32px; max-width: 480px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-img { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }

@media (min-width: 992px) {
    .hero-grid { grid-template-columns: 1fr 1fr; gap: 80px; }
}

/* ─── 9. CARDS ──────────────────────────────────────────────────── */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.card-img   { aspect-ratio: 16 / 10; background: var(--sky-pale); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-title { font-family: var(--serif); font-size: 1.3rem; margin-bottom: 8px; }
.card-meta  { font-size: .85rem; color: var(--ink-faded); }
.card-price { font-size: 1.5rem; font-weight: 500; color: var(--sky-mid); }

/* Grid de cards */
.cards-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 600px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .cards-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .cards-grid.cards-4 { grid-template-columns: repeat(4, 1fr); } }

/* ─── 10. FORMULARIOS ───────────────────────────────────────────── */
.form-group   { margin-bottom: 20px; }
.form-group label {
    display: block; margin-bottom: 8px; font-size: .85rem;
    font-weight: 500; color: var(--ink-soft); letter-spacing: .04em;
}
.form-control, .form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 12px 14px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: white; font-size: 1rem; transition: var(--transition);
    min-height: 48px;
}
.form-control:focus, .form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(0, 174, 239, .1);
}
.form-control[aria-invalid="true"] { border-color: var(--error); }
.form-error    { color: var(--error); font-size: .85rem; margin-top: 4px; }
.form-success  { color: var(--success); font-size: .85rem; margin-top: 4px; }
.form-row      { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 600px) { .form-row.cols-2 { grid-template-columns: 1fr 1fr; } }

/* Alertas */
.alert         { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; font-size: .95rem; }
.alert-error   { background: #fdecea; color: var(--error); }
.alert-success { background: #e6f6ec; color: var(--success); }
.alert-info    { background: var(--sky-pale); color: var(--sky-mid); }

/* ─── 11. AUTH (login, registro) ────────────────────────────────── */
.auth-page  { min-height: 100vh; display: flex; align-items: center; padding: 40px 20px; }
.auth-card  {
    width: 100%; max-width: 440px; margin: 0 auto;
    background: white; border-radius: var(--radius-lg);
    padding: 32px 24px; box-shadow: var(--shadow);
}
.auth-card h1 { text-align: center; margin-bottom: 8px; }
.auth-card .subtitle { text-align: center; margin-bottom: 24px; color: var(--ink-faded); }
.auth-links { text-align: center; margin-top: 20px; font-size: .9rem; }
.auth-links a { color: var(--sky-mid); }

@media (min-width: 600px) { .auth-card { padding: 48px 40px; } }

/* ─── 12. CATÁLOGO + CARRITO ────────────────────────────────────── */
.product-card { display: flex; flex-direction: column; height: 100%; }
.product-card .btn { margin-top: auto; }

.cart-sticky {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
    background: white; padding: 16px 20px;
    box-shadow: 0 -4px 20px rgba(0,0,0,.1);
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    transform: translateY(100%); transition: transform var(--transition);
}
.cart-sticky.show { transform: translateY(0); }
.cart-total { font-weight: 500; }
.cart-total span { color: var(--sky-mid); font-size: 1.2rem; }

@media (min-width: 768px) { .cart-sticky { padding: 20px 32px; } }

/* ─── 13. CHECKOUT / GRACIAS ────────────────────────────────────── */
.success-page {
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center; padding: 40px 20px;
}
.success-icon {
    width: 96px; height: 96px; border-radius: 50%;
    background: var(--success); color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; margin-bottom: 24px;
}

/* ─── 14. FOOTER ────────────────────────────────────────────────── */
.site-footer { background: var(--ink); color: var(--cream); padding: 60px 0 24px; margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 40px; margin-bottom: 40px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }

.footer-col h4   { color: white; margin-bottom: 16px; font-size: 1.1rem; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a    { color: var(--cream); opacity: .7; transition: opacity var(--transition); }
.footer-col a:hover { opacity: 1; color: var(--sky); }
.footer-bottom   { border-top: 1px solid rgba(255,255,255,.1); padding-top: 24px;
                   text-align: center; font-size: .85rem; opacity: .6; }

/* WhatsApp flotante */
.whatsapp-float {
    position: fixed; bottom: 20px; right: 20px; z-index: 80;
    width: 56px; height: 56px; border-radius: 50%;
    background: #25d366; color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; box-shadow: var(--shadow-lg);
    transition: var(--transition);
}
.whatsapp-float:hover { transform: scale(1.1); }
@media (min-width: 768px) { .whatsapp-float { width: 64px; height: 64px; bottom: 32px; right: 32px; } }

/* ─── 15. UTILIDADES DE ESPACIADO ───────────────────────────────── */
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

/* ─── 16. LOADING ───────────────────────────────────────────────── */
.spinner {
    display: inline-block; width: 20px; height: 20px;
    border: 2px solid rgba(0,174,239,.2);
    border-top-color: var(--sky);
    border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
    position: fixed; inset: 0; background: rgba(255,255,255,.85);
    display: flex; align-items: center; justify-content: center; z-index: 200;
}
.loading-overlay .spinner { width: 40px; height: 40px; border-width: 3px; }
