/* =========================================
   DESIGN TOKENS & VARIABLES
========================================= */
:root {
    /* Color Palette */
    --clr-bg: #FFFFFF;
    --clr-bg-light: #F8F9FA;
    --clr-text-main: #1C1917;
    /* Dark grayish brown */
    --clr-text-muted: #57534E;

    --clr-primary: #8B5A2B;
    /* Warm wood accent */
    --clr-primary-light: #A67B54;
    --clr-primary-dark: #66411F;

    --clr-secondary: #4A5D4E;
    /* Subtle sage green */
    --clr-whatsapp: #25D366;

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;

    /* Layout & Spacing */
    --container-width: 1200px;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* Radii & Shadows */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 24px;

    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-float: 0 15px 30px -5px rgba(139, 90, 43, 0.2);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================
   RESET & BASE STYLES
========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    /* Offset for sticky header */
}

body {
    font-family: var(--font-body);
    color: var(--clr-text-main);
    background-color: var(--clr-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

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

/* =========================================
   LAYOUT UTILITIES
========================================= */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: var(--spacing-xl) 0;
}

.bg-light {
    background-color: var(--clr-bg-light);
}

.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: 2rem;
}

/* =========================================
   TYPOGRAPHY
========================================= */
.section-tag {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--clr-primary);
    margin-bottom: 1rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--clr-text-main);
}

.section-desc {
    font-size: 1.125rem;
    color: var(--clr-text-muted);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* =========================================
   COMPONENTS
========================================= */
/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 1px solid transparent;
}

.btn-sm {
    padding: 0.6rem 1.25rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-primary {
    background-color: var(--clr-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--clr-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-float);
}

.btn-outline {
    background-color: transparent;
    border-color: white;
    color: white;
}

.btn-outline:hover {
    background-color: white;
    color: var(--clr-text-main);
}

.btn-outline-light {
    border-color: rgba(255, 255, 255, 0.6);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all var(--transition-normal);
    padding: 1.5rem 0;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: var(--shadow-sm);
}

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

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    transition: color var(--transition-normal);
}

.navbar.scrolled .logo {
    color: var(--clr-text-main);
}

.logo .accent {
    color: var(--clr-primary);
    font-family: var(--font-body);
    font-weight: 300;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
}

.navbar.scrolled .nav-links a {
    color: var(--clr-text-main);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--clr-primary);
    transition: width var(--transition-normal);
}

.nav-links a:hover::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 2rem;
    color: white;
    cursor: pointer;
}

.navbar.scrolled .mobile-menu-btn {
    color: var(--clr-text-main);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding-top: var(--nav-height);
    background-image: url('https://pisospersianas.com.mx/wp-content/uploads/elementor/thumbs/WhatsApp-Image-2024-07-24-at-12.04.28-PM-qrlfwkwszrrv2dit1etwo0sm42zbjj3leqn4qasy3k.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.4) 100%);
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    color: white;
}

.hero-title {
    font-size: clamp(3rem, 6vw, 4.5rem);
    color: white;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2.5rem;
    font-weight: 300;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    animation: bounce 2s infinite;
}

.scroll-indicator a {
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 1.5rem;
    opacity: 0.8;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-15px);
    }

    60% {
        transform: translateY(-7px);
    }
}

/* Specialties Section */
.specialties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.specialty-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.specialty-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.card-img-wrapper {
    position: relative;
    height: 240px;
    overflow: hidden;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.specialty-card:hover .card-img-wrapper img {
    transform: scale(1.08);
}

.card-header {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.card-content p {
    color: var(--clr-text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.toggle-gallery {
    align-self: flex-start;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border: 1px solid var(--clr-bg-light);
    background-color: var(--clr-bg-light);
    color: var(--clr-text-main);
}

.toggle-gallery.active {
    background-color: var(--clr-primary);
    color: white;
    border-color: var(--clr-primary);
}

.card-gallery {
    display: none;
    padding: 1.5rem;
    background-color: #fafafa;
    border-top: 1px solid #eaeaea;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    animation: fadeUp 0.4s ease forwards;
}

.card-gallery.show {
    display: grid;
}

.card-gallery img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.card-gallery img:hover {
    transform: scale(1.05);
}

/* Showroom Section */
.showroom-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.showroom .rounded-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

/* Benefits Section */
.benefits-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.benefits-image {
    position: relative;
}

.rounded-image {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.floating-badge {
    position: absolute;
    bottom: -2rem;
    right: -2rem;
    background: var(--clr-bg);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.badge-number {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--clr-primary);
    line-height: 1;
}

.badge-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--clr-text-muted);
    line-height: 1.2;
}

.benefits-list {
    display: grid;
    gap: 1.5rem;
    margin-top: 2rem;
}

.benefit-item {
    display: flex;
    gap: 1rem;
}

.icon-box {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background-color: rgba(139, 90, 43, 0.1);
    color: var(--clr-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.benefit-item h4 {
    margin-bottom: 0.25rem;
    font-family: var(--font-body);
    font-size: 1.125rem;
}

.benefit-item p {
    color: var(--clr-text-muted);
    font-size: 0.95rem;
}

/* Contact Section */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.contact-methods {
    margin-top: 2rem;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background-color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

.contact-method h5 {
    margin: 0;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--clr-text-muted);
}

.contact-link {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--clr-text-main);
}

.contact-link:hover {
    color: var(--clr-primary);
}

.contact-form-wrapper {
    background: white;
    padding: 3rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.contact-form-wrapper h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.contact-form-wrapper p {
    color: var(--clr-text-muted);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--clr-text-main);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid #E5E7EB;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all var(--transition-fast);
    background-color: #F9FAFB;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 3px rgba(139, 90, 43, 0.1);
}

.btn-block {
    width: 100%;
    display: flex;
}

/* Footer */
.footer {
    background-color: #111111;
    color: #a0a0a0;
    padding: 5rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 3rem;
}

.footer-logo {
    color: white;
    margin-bottom: 1rem;
    display: inline-block;
}

.footer-logo .accent {
    color: var(--clr-primary);
}

.footer-desc {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    transition: all var(--transition-fast);
}

.social-links a:hover {
    background-color: var(--clr-primary);
    transform: translateY(-3px);
}

.footer-col h4 {
    color: white;
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    font-family: var(--font-body);
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a:hover {
    color: white;
}

.footer-contact li {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.footer-contact i {
    color: var(--clr-primary);
    font-size: 1.25rem;
    margin-top: 2px;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

/* Floating WhatsApp */
.floating-whatsapp {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--clr-whatsapp);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
    z-index: 100;
    transition: transform var(--transition-fast);
}

.floating-whatsapp:hover {
    transform: scale(1.1);
}

.whatsapp-tooltip {
    position: absolute;
    right: 75px;
    background-color: white;
    color: var(--clr-text-main);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.floating-whatsapp:hover .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
    right: 80px;
}

/* Animations */
.animate-fade-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   RESPONSIVE (Mobile First approach applied via max-width queries)
========================================= */
@media (max-width: 992px) {
    .benefits-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .floating-badge {
        right: 0;
        bottom: -1rem;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .brand-col {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* simple mobile menu toggle via JS required */
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav-actions .btn {
        display: none;
    }

    .hero-title {
        font-size: 2.5rem;
    }

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

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .floating-whatsapp {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }
}

/* =========================================
   PRELOADER ANIMATION
========================================= */
.preloader {
    position: fixed;
    inset: 0;
    background-color: var(--clr-bg);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
}

.preloader-content {
    text-align: center;
    overflow: hidden;
    padding: 2rem;
}

.preloader .logo-text {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    color: var(--clr-text-main);
    opacity: 0;
    transform: translateY(30px);
    display: inline-block;
    animation: preloaderTextReveal 1s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.2s;
}

.preloader .accent {
    color: var(--clr-primary);
    font-family: var(--font-body);
    font-weight: 300;
    display: inline-block;
    opacity: 0;
    transform: rotate(-180deg) scale(0);
    animation: preloaderSpinIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 0.8s;
}

.loader-line {
    width: 0;
    height: 2px;
    background-color: var(--clr-primary);
    margin: 1.5rem auto 0;
    animation: preloaderLine 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards 1.2s;
}

.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

@keyframes preloaderTextReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes preloaderSpinIn {
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

@keyframes preloaderLine {
    0% {
        width: 0;
        opacity: 1;
    }

    40% {
        width: 120px;
        opacity: 1;
    }

    80% {
        width: 120px;
        opacity: 0;
    }

    100% {
        width: 120px;
        opacity: 0;
    }
}