:root {
    --primary: #5a2a27;
    /* Bordeaux from user image */
    --accent: #5a2a27;
    --accent-dark: #401e1c;
    --accent-light: #7a3a36;
    --bordeaux: #5a2a27;
    --bordeaux-dark: #401e1c;
    --bordeaux-light: #7a3a36;
    --white: #ffffff;
    --off-white: #fdfaf9;
    /* Slightly warm off-white */
    --text-dark: #2c1412;
    /* Very dark bordeaux/brown for text */
    --text-muted: #6e5a59;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    --font-main: 'Poppins', sans-serif;
    --font-serif: 'Georgia', serif;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --white: #1a0d0c;
    --off-white: #251211;
    --text-dark: #fdfaf9;
    --text-muted: #a89190;
    --accent: #7a3a36;
    --accent-dark: #fdfaf9;
    --bordeaux: #7a3a36;
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--off-white);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-dark);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 20px;
}

[data-theme="dark"] .theme-toggle {
    border-color: rgba(255, 255, 255, 0.1);
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: var(--accent);
    color: white;
}

.theme-toggle i {
    font-size: 1.2rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    font-family: var(--font-main);
    font-weight: 300;
    /* Poppins Light */
    line-height: 1.8;
    color: var(--text-dark);
    background-color: var(--white);
    overflow-x: hidden;
    width: 100%;
}


h1,
h2,
h3,
h4 {
    font-family: var(--font-serif);
    font-weight: 400;
    color: var(--primary);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Navbar */
nav {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    background: var(--white);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] nav {
    background: rgba(26, 26, 26, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

/* Standard Logo Styling - New PNG Assets */
.logo img,
.footer-logo img,
.hero-logo-container img,
.about-logo-monogram img {
    width: auto;
    display: block;
    object-fit: contain;
    transition: var(--transition);
}

.main-logo-img {
    height: 85px;
}

.hero-logo-img {
    max-height: 320px;
    /* Increased for "logazo" */
    margin: 0 auto 30px;
}

.footer-logo img {
    max-height: 180px;
    margin: 0 auto;
}

/* Light mode: apply a gold filter to white PNGs so they are visible on white background */
.logo img,
.footer-logo img,
.about-logo-monogram img {
    filter: brightness(0) saturate(100%) invert(18%) sepia(21%) saturate(2214%) hue-rotate(320deg) brightness(95%) contrast(93%);
    /* This filter forces the asset to black first, then applies the exact #5a2a27 bordeaux color */
}

/* Dark mode handling: remove gold filter and boost brightness for visibility on dark background */
[data-theme="dark"] .logo img,
[data-theme="dark"] .footer-logo img,
[data-theme="dark"] .about-logo-monogram img {
    filter: brightness(1.5) contrast(0.9);
}

/* Ensure visibility on Hero (always dark background) */
.hero .hero-logo-img {
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5)) brightness(1.5);
}

/* About Sectionmark */
.about-logo-monogram img {
    max-height: 240px;
    opacity: 0.15;
}

/* Ensure team text is readable across themes */
.team-card {
    background: var(--white) !important;
    color: var(--text-dark) !important;
}

.team-card h2 {
    color: var(--bordeaux-dark) !important;
}

.team-card p {
    color: var(--text-dark) !important;
}

[data-theme="dark"] .team-card {
    background: #2a2a2a !important;
    border-color: #444 !important;
}

[data-theme="dark"] .team-card h2 {
    color: white !important;
}

[data-theme="dark"] .team-card p,
[data-theme="dark"] .team-card div {
    color: #e0e0e0 !important;
}





.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-links a:hover {
    color: var(--bordeaux);
}

.btn-whatsapp-nav {
    background-color: var(--accent);
    color: white !important;
    padding: 10px 24px;
    border-radius: 5px;
    font-weight: 400;
    /* Light weight for cleaner look */
    letter-spacing: 0.5px;
}

.btn-whatsapp-nav:hover {
    background-color: var(--accent-dark);
}

/* Hero Section */
.hero {
    height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../assets/oficina.jpeg');
    background-size: cover;
    background-position: center 25%;
    color: white;
    text-align: center;
}

.hero-content {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-home-content {
    padding: 240px 20px 0;
}


.hero-logo {
    max-height: 150px;
    margin-bottom: 20px;
    animation: fadeInUp 0.8s ease-out;
}

.hero-content h1 {
    font-size: 3.5rem;
    color: white;
    margin-bottom: 0.5rem;
    animation: fadeInUp 1s ease-out;
}

.hero-content p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    font-weight: 300;
    animation: fadeInUp 1.2s ease-out;
}

.hero-btns {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1.4s ease-out;
}


.btn {
    padding: 15px 30px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
}

.btn-primary {
    background-color: var(--accent);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-dark);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid currentColor;
    color: inherit;
}

.btn-secondary:hover {
    background-color: var(--bordeaux);
    border-color: var(--bordeaux);
    color: white;
}

/* Section Common */
section {
    padding: 100px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.section-title .underline {
    width: 60px;
    height: 2px;
    background-color: var(--accent);
    margin: 0 auto;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-text h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.about-text p {
    margin-bottom: 1rem;
}

/* Practice Areas */
.areas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.area-card {
    padding: 40px;
    background: var(--off-white);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    transition: var(--transition);
    text-align: center;
}

[data-theme="dark"] .area-card {
    border-color: rgba(255, 255, 255, 0.05);
}

.area-card:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    transform: translateY(-8px);
    border-color: var(--accent);
}

.area-card i {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.area-card h3 {
    margin-bottom: 1rem;
}

.area-card .btn-text {
    color: var(--accent);
    font-weight: 400;
    display: inline-block;
    margin-top: 1rem;
    letter-spacing: 0.5px;
}

/* Floating WhatsApp */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    transition: var(--transition);
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

.whatsapp-msg {
    position: absolute;
    right: 70px;
    background: white;
    color: black;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    width: 200px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: none;
    animation: fadeIn 0.5s forwards;
}

.whatsapp-float:hover .whatsapp-msg {
    display: block;
}

/* Footer */
footer {
    background-color: var(--white);
    padding: 50px 0;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] footer {
    border-top-color: rgba(255, 255, 255, 0.05);
}

/* FAQ */
details {
    background: var(--off-white);
    margin-bottom: 15px;
    border-radius: 8px;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] details {
    border-color: rgba(255, 255, 255, 0.05);
}

details[open] {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

summary {
    list-style: none;
}

summary::-webkit-details-marker {
    display: none;
}

/* Team */
.team-card {
    transition: var(--transition);
}

.team-card:hover {
    transform: translateY(-10px);
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Testimonials */
.testigos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}


.testimonial-card {
    background: var(--off-white);
    padding: 40px;
    border-radius: 15px;
    position: relative;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border-color: var(--bordeaux-light);
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: 10px;
    left: 20px;
    font-size: 5rem;
    color: var(--bordeaux);
    opacity: 0.1;
    font-family: var(--font-serif);
}

.stars {
    color: #ffc107;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.testimonial-card p {
    font-style: italic;
    color: var(--text-dark);
    margin-bottom: 20px;
    line-height: 1.7;
    flex-grow: 1;
}

.testimonial-card .author {
    display: flex;
    flex-direction: column;
}

.testimonial-card .author strong {
    color: var(--bordeaux-dark);
    font-size: 1.1rem;
}

.testimonial-card .author span {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Responsive */
.nav-toggle {
    display: none;
}

@media (max-width: 992px) {
    .nav-toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        z-index: 1002;
    }

    .nav-toggle span {
        width: 30px;
        height: 3px;
        background-color: var(--text-dark);
        border-radius: 3px;
        transition: var(--transition);
    }

    /* Animation for toggle */
    .nav-toggle.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 100%;
        background-color: var(--white);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: right 0.4s ease-in-out;
        z-index: 1001;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        display: flex !important;
        /* Siempre flex en móvil para que funcione la transición */
        visibility: hidden;
        /* Oculto pero permite transición */
        opacity: 0;
    }

    .nav-links.active {
        right: 0 !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links a {
        font-size: 1.2rem;
        display: block;
        padding: 10px;
    }

    .theme-toggle {
        margin-left: 0;
        margin-top: 10px;
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-content p {
        font-size: 1.2rem;
    }

    .hero-btns {
        flex-direction: column;
        align-items: center;
    }

    .hero-btns .btn {
        width: 100%;
        max-width: 320px;
    }

    .hero-home-content {
        padding-top: 180px;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    section {
        padding: 60px 0;
    }
}

@media (max-width: 480px) {
    .main-logo-img {
        height: 60px;
    }

    nav {
        height: 80px;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .hero-home-content {
        padding-top: 140px;
    }

    .testimonial-card {
        padding: 25px;
    }
}