/* ========================================
   SAR ABOGADOS - ULTRA FAST STYLES
   Optimized for speed and modern design
   ======================================== */

/* ========== FONTS ========== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;900&family=Inter:wght@300;400;500;600;700&display=swap');

/* ========== VARIABLES ========== */
:root {
    --primary: #4B0082;
    --primary-light: #6A0DAD;
    --primary-dark: #3A006F;
    --secondary: #1E3A8A;
    --accent: #8B5CF6;
    --text-dark: #1a1a1a;
    --text-medium: #4a4a4a;
    --text-light: #6a6a6a;
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --gradient-primary: linear-gradient(135deg, #4B0082, #6A0DAD);
    --gradient-hero: linear-gradient(135deg, rgba(76, 0, 130, 0.85), rgba(25, 25, 112, 0.9));
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
    --header-height: clamp(64px, 8vh, 96px);
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Playfair Display', Georgia, serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== BASE ========== */
* { box-sizing: border-box; }
body { font-family: var(--font-primary); color: var(--text-dark); line-height: 1.6; padding-top: var(--header-height, 96px); }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

@media (max-width: 768px) {
    :root {
        --header-height: clamp(72px, 12vh, 140px);
    }
}

/* ========== CONTAINER ========== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

/* ========== HEADER ========== */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: var(--transition);
}
.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}
.logo img { height: 50px; width: auto; }
.nav { display: flex; align-items: center; gap: 2rem; }
.nav-list {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-link {
    color: var(--text-medium);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--primary); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}
.menu-toggle span {
    width: 26px;
    height: 3px;
    background: var(--text-dark);
    border-radius: 3px;
    transition: var(--transition);
}

.btn-header { display: none; }

/* ========== BUTTONS ========== */
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(75, 0, 130, 0.3);
    display: inline-block;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(75, 0, 130, 0.4);
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.05rem;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 2px solid rgba(255,255,255,0.4);
    backdrop-filter: blur(10px);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.6);
    transform: translateY(-2px);
}

/* ========== HERO VIDEO ========== */
.hero-video-container {
    position: relative;
    min-height: calc(100vh - var(--header-height));
    overflow: hidden;
    display: flex;
    align-items: center;
}

@supports (height: 100dvh) {
    .hero-video-container {
        min-height: calc(100dvh - var(--header-height));
    }
}
.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 0;
}
video::-webkit-media-controls {
    display: none !important;
}
video::-webkit-media-controls-enclosure {
    display: none !important;
}
video::-webkit-media-controls-panel {
    display: none !important;
}
video::-webkit-media-controls-play-button {
    display: none !important;
}
.hero-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-hero);
    z-index: 1;
}
.hero-content {
    position: relative;
    z-index: 2;
    color: white;
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(3.5rem, 10vh, 8rem) 2rem clamp(2.5rem, 8vh, 6rem);
    text-align: center;
}
.hero-logo {
    max-width: 350px;
    width: 100%;
    height: auto;
    margin: 0 auto 1.5rem;
    filter: drop-shadow(0 8px 24px rgba(255,255,255,0.8)) drop-shadow(0 0 40px rgba(255,255,255,0.6)) drop-shadow(0 4px 12px rgba(0,0,0,0.3));
    display: block;
    animation: fadeInUp 0.8s ease;
}
.hero-subtitle {
    font-size: 1.3rem;
    opacity: 0.95;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 300;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease 0.2s both;
}
.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    animation: fadeInUp 0.8s ease 0.2s both;
}
.hero-text {
    font-size: clamp(1rem, 2vw, 1.25rem);
    max-width: 700px;
    margin: 0 auto 2.5rem;
    opacity: 0.95;
    line-height: 1.8;
    animation: fadeInUp 0.8s ease 0.4s both;
}
.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.6s both;
}
.hero-scroll-indicator {
    position: relative;
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.8;
    animation: bounce 2s infinite;
}
.hero-scroll-indicator span {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.hero-scroll-indicator svg {
    width: 24px;
    height: 24px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ========== FEATURES SLIDER ========== */
.features-slider {
    background: white;
    padding: 3rem 0;
}
.slider-track {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}
.feature-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
}
.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}
.feature-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.feature-card h3 {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    color: white;
    padding: 2rem 1.5rem 1rem;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

/* ========== ABOUT SECTION ========== */
.about-section {
    padding: 6rem 0;
    background: var(--bg-light);
}

.despacho-intro {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 5rem;
}
.despacho-intro h2 {
    font-family: var(--font-heading);
    font-size: 2.75rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    font-weight: 700;
}
.despacho-intro .lead {
    font-size: 1.25rem;
    color: var(--text-medium);
    font-weight: 500;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}
.despacho-intro p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: start;
}
.about-image {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.about-image img {
    width: 100%;
    height: auto;
}
.about-experience {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    background: var(--gradient-primary);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}
.experience-number {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}
.experience-text {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    opacity: 0.95;
}

.section-label {
    display: inline-block;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
}
.about-content h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    font-weight: 700;
}
.about-content .lead {
    font-size: 1.2rem;
    color: var(--text-medium);
    font-weight: 500;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}
.about-content p {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.about-content h2 {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    font-weight: 700;
}
.link-primary {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
}
.signature {
    font-style: italic;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--bg-light);
}

/* ========== SERVICES SECTION ========== */
.services-section {
    padding: 6rem 0;
    background: white;
}
.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 4rem;
}
.section-header h2 {
    font-family: var(--font-heading);
    font-size: 2.75rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}
.section-header p {
    font-size: 1.1rem;
    color: var(--text-light);
}

.service-full {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 5rem;
    align-items: start;
}
.service-full.reverse {
    grid-template-columns: 1fr 1fr;
}
.service-full-content h3 {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}
.service-full-content p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}
.service-subsection {
    margin: 2rem 0 1.5rem;
}
.service-subsection h4 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}
.service-list {
    list-style: none;
    padding: 0;
}
.service-list li {
    padding: 0.75rem 0;
    color: var(--text-medium);
    line-height: 1.7;
    padding-left: 1.5rem;
    position: relative;
}
.service-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.service-list-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.service-icons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.service-icon-item {
    text-align: center;
}
.service-icon-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.service-icon-item:hover .service-icon-circle {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}
.service-icon-item p {
    font-size: 0.95rem;
    color: var(--text-medium);
    margin: 0;
}

.service-full-image {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.service-full-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========== ACCORDION ========== */
.service-accordion {
    margin-top: 1.5rem;
}
.accordion-item {
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}
.accordion-header {
    width: 100%;
    background: white;
    border: none;
    padding: 1.25rem 1.5rem;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}
.accordion-header:hover {
    background: var(--bg-light);
}
.accordion-header.active {
    background: var(--bg-light);
}
.accordion-icon {
    font-size: 1.5rem;
    transition: transform var(--transition);
}
.accordion-header.active .accordion-icon {
    transform: rotate(180deg);
}
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.accordion-content.active {
    max-height: 2000px;
}
.accordion-body {
    padding: 1.5rem;
}

/* ========== CONTACT SECTION ========== */
.contact-section {
    position: relative;
    padding: 6rem 0;
    min-height: 80vh;
    display: flex;
    align-items: center;
}
.contact-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}
.contact-video-bg video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
}
.contact-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.92), rgba(76, 0, 130, 0.92));
    z-index: 1;
}
.contact-content {
    position: relative;
    z-index: 2;
}
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    margin-bottom: 4rem;
}
.contact-info {
    color: white;
}
.contact-info h2 {
    font-family: var(--font-heading);
    font-size: 2.75rem;
    margin-bottom: 1.5rem;
}
.contact-subtitle {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    opacity: 0.95;
}
.contact-info p {
    line-height: 1.8;
    opacity: 0.9;
}

.contact-form {
    background: rgba(255,255,255,0.98);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: var(--transition);
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(75, 0, 130, 0.1);
}
.form-group textarea {
    resize: vertical;
}
.btn-submit {
    width: 100%;
    background: var(--gradient-primary);
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    transition: var(--transition);
}
.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.recaptcha-notice {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-light);
    text-align: center;
    line-height: 1.5;
}
.recaptcha-notice a {
    color: var(--primary);
    text-decoration: underline;
}

.contact-bottom {
    text-align: center;
    color: white;
}
.contact-bottom h3 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    line-height: 1.4;
}
.brand-highlight {
    display: inline-block;
    padding: 0 0.5rem;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
    border-radius: 8px;
}

/* ========== FOOTER ========== */
.footer {
    background: #1a1a1a;
    color: rgba(255,255,255,0.8);
    padding: 3rem 0 2rem;
}
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}
.footer-logo img {
    max-width: 150px;
    margin-bottom: 1rem;
}
.footer-contact p {
    margin-bottom: 0.5rem;
}
.footer-contact a {
    color: rgba(255,255,255,0.9);
    transition: var(--transition);
}
.footer-contact a:hover {
    color: white;
}

/* ========== FLOATING CONTACTS ========== */
.floating-contacts {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 999;
}
.float-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}
.float-btn:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.phone-btn { background: linear-gradient(135deg, #4B0082, #6A0DAD); }
.email-btn {
    background: linear-gradient(135deg, #DC2626, #EF4444);
}
.email-btn svg {
    fill: white;
}
.whatsapp-btn { background: linear-gradient(135deg, #25D366, #20BA5A); }
.float-btn svg {
    width: 28px;
    height: 28px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .about-grid,
    .contact-grid,
    .service-full,
    .service-full.reverse {
        grid-template-columns: 1fr;
    }

    /* Forzar que las imágenes aparezcan primero en móvil */
    .service-full,
    .service-full.reverse {
        display: flex;
        flex-direction: column;
    }
    .service-full-image {
        order: -1;
    }
    .service-full-content {
        order: 1;
    }

    .service-list-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container { padding: 0 1.5rem; }

    .header-content { padding: 0.75rem 1.5rem; }

    .nav-list {
        position: fixed;
        top: 100%;
        left: -100%;
        width: 100%;
        background: white;
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem;
        box-shadow: var(--shadow-lg);
        transition: left 0.3s ease;
        z-index: 999;
    }
    .nav-list.active { left: 0; }

    .menu-toggle { display: flex; }

    .btn-header { display: block; }

    .hero-title { font-size: 2rem; }
    .hero-text { font-size: 1rem; }
    .hero-cta { flex-direction: column; }
    .btn-large { width: 100%; justify-content: center; }
    .hero-content { padding: 5rem 1.5rem 3.5rem; }

    .slider-track {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-section,
    .services-section,
    .contact-section { padding: 4rem 0; }

    .section-header h2 { font-size: 2rem; }
    .about-content h2 { font-size: 2rem; }
    .service-full-content h3 { font-size: 1.75rem; }

    .service-icons-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1rem;
    }

    .floating-contacts {
        bottom: 1rem;
        right: 1rem;
    }
    .float-btn {
        width: 50px;
        height: 50px;
    }
    .float-btn svg {
        width: 24px;
        height: 24px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .logo img { height: 40px; }
    .hero-logo {
        max-width: 250px;
        margin: 0 auto 1.5rem;
    }
    .hero-content { padding: 4.5rem 1.25rem 3rem; }
    .about-experience {
        bottom: 1rem;
        right: 1rem;
        padding: 1rem;
    }
    .experience-number { font-size: 2rem; }
}
