/* Custom Styles for REIDITE Electronics */

/* Screen-reader only: visible to crawlers and assistive tech, hidden visually */
.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;
}

/* ===== CROSS-BROWSER & MOBILE FIXES ===== */
/* NO overflow on html/body - breaks position:fixed navbar on iOS Safari */
html {
    -ms-overflow-style: scrollbar;
    scroll-behavior: smooth;
    font-size: 15px;
}

body {
    min-width: 0;
    padding-top: 0;
    font-size: 0.875rem;
    -webkit-text-size-adjust: 100%;
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

/* Evitar espacio blanco excesivo antes del footer: el contenido no fuerza altura mínima */
.main-content {
    min-height: 0;
}

/* Ensure images and embedded media don't overflow on mobile */
img, video, svg {
    max-width: 100%;
    height: auto;
}

/* ===== CONTAINER - MOBILE-FIRST PADDING ===== */
/* Wider max-width so content uses more of the viewport (no "apelotonado" en el centro) */
.container {
    max-width: 1536px;
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

@media (min-width: 640px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 768px) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding-left: 4rem;
        padding-right: 4rem;
    }
}

@media (min-width: 1280px) {
    .container {
        padding-left: 6rem;
        padding-right: 6rem;
    }
}

@media (min-width: 1536px) {
    .container {
        padding-left: 8rem;
        padding-right: 8rem;
    }
}

/* Section padding - compact spacing. scroll-margin for fixed navbar (avoid overlap on scroll/anchor) */
section {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
    scroll-margin-top: 5rem;
}

@media (min-width: 768px) {
    section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}

/* Headings that may scroll under fixed navbar */
h2 {
    scroll-margin-top: 5.5rem;
}

/* Navbar - ensure fixed position works on iOS/mobile */
#navbar,
nav#navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Navbar scrolled state - slightly more opaque */
.navbar.scrolled {
    background-color: rgba(5, 5, 5, 0.95) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

/* Navbar active page: blue text + underline */
#navbar .nav-active,
#navbar a.nav-active {
    color: #83b1d6 !important;
}
#navbar .nav-active span.absolute.bottom-0 {
    width: 100% !important;
}

/* Mobile menu - safe area for notched phones, ensure proper stacking */
#mobileMenu {
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

#mobileMenu.active {
    transform: translateX(0);
}

/* Mobile: ensure touch targets are adequate (min 44px) */
@media (max-width: 767px) {
    #mobileMenu a,
    #mobileMenu button {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
}

/* Products toggle in mobile nav: ensure it receives taps and shows submenu */
#mobileProductsToggle {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
#mobileProductsMenu:not(.hidden) {
    display: block;
}

/* Mobile menu toggle animation */
#mobileMenuToggle.active #menuLine1 {
    transform: rotate(45deg) translate(5px, 5px);
}

#mobileMenuToggle.active #menuLine2 {
    opacity: 0;
}

#mobileMenuToggle.active #menuLine3 {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Page transitions */
.page-content {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form animations */
.form-success {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading spinner */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Products Dropdown - responsive width for smaller viewports */
#productsDropdown {
    max-width: min(700px, calc(100vw - 2rem));
}

@media (max-width: 1100px) {
    #productsDropdown {
        width: calc(100vw - 2rem);
    }
}

/* Products Dropdown */
.products-dropdown {
    pointer-events: none;
}

.group:hover .products-dropdown {
    pointer-events: auto;
}

/* Optimize heading sizes for better fit */
h1 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

/* Producto (Xiphos, Zenith): títulos de sección y de especificaciones/descargas más contenidos */
.product-specs-section h3,
.product-download-cards h3 {
    font-size: 1rem;
    font-weight: 600;
}
.product-page-section-title {
    font-size: 1.5rem !important; /* text-2xl equivalente para h2 de sección */
}

/* Reduce excessive margins */
.mb-16 {
    margin-bottom: 3rem;
}

.mb-20 {
    margin-bottom: 3.5rem;
}

@media (max-width: 768px) {
    .mb-16 {
        margin-bottom: 2.5rem;
    }
    
    .mb-20 {
        margin-bottom: 3rem;
    }
}

/* Global text size reduction */
p, li, span, a {
    font-size: 0.875rem; /* 14px base */
}

.text-sm {
    font-size: 0.8125rem !important; /* ~13px */
}

.text-base {
    font-size: 0.875rem !important; /* 14px */
}

.text-lg {
    font-size: 1rem !important; /* 16px instead of 18px */
}

.text-xl {
    font-size: 1.125rem !important; /* 18px instead of 20px */
}

.text-2xl {
    font-size: 1.375rem !important; /* 22px instead of 24px */
}

.text-3xl {
    font-size: 1.625rem !important; /* 26px instead of 30px */
}

/* Backdrop-filter with -webkit- prefix for Safari, fallback for Edge when unsupported */

/* Hero Section with Diagonal Cut and Carousel */
.hero-left-content {
    clip-path: polygon(0 0, 65% 0, 50% 100%, 0 100%);
    background: rgba(5, 5, 5, 0.85); /* Slightly more opaque fallback when backdrop-filter unsupported */
    min-height: 100vh;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
    box-shadow: none;
}

@supports ((-webkit-backdrop-filter: blur(3px)) or (backdrop-filter: blur(3px))) {
    .hero-left-content {
        background: rgba(5, 5, 5, 0.78);
        -webkit-backdrop-filter: blur(3px);
        backdrop-filter: blur(3px);
    }
}

.hero-left-content .container {
    position: relative;
    z-index: 50;
    pointer-events: auto;
}

.hero-left-content .page-content {
    position: relative;
    z-index: 51;
}

/* Hero content layout: keep ISO row visible on short screens */
.hero-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.home-hero .hero-content {
    min-height: 100%;
    position: relative;
}

.hero-left-shift {
    padding-left: 1rem;
}

@media (min-width: 640px) {
    .hero-left-shift {
        padding-left: 1.5rem;
    }
}

@media (min-width: 768px) {
    .hero-left-shift {
        padding-left: 2.5rem;
    }
}

@media (min-width: 1024px) {
    .hero-left-shift {
        padding-left: 3rem;
    }
}

.hero-iso {
    margin-top: auto;
    padding-bottom: 6rem;
}

/* Desktop: ISO at bottom of left panel */
@media (min-width: 769px) {
    .hero-iso {
        position: absolute;
        left: 0;
        bottom: 2rem;
        padding-bottom: 0;
        width: auto;
    }
}

.home-hero .hero-iso {
    position: absolute;
    left: 0;
    bottom: -21rem;
    padding-bottom: 0;
    width: 100%;
}

@media (min-width: 769px) {
    .home-hero .hero-iso {
        bottom: 2rem;
        width: auto;
    }
}

@media (min-width: 1280px) {
    .home-hero .hero-iso {
        bottom: -4.5rem;
    }
}

@media (max-height: 800px) {
    .hero-iso {
        padding-bottom: 4rem;
    }
}

@media (max-height: 680px) {
    .hero-iso {
        padding-bottom: 3rem;
    }
}

/* Products page hero */
.products-hero {
    background: radial-gradient(circle at 20% 20%, rgba(131, 177, 214, 0.25), transparent 45%),
                radial-gradient(circle at 80% 10%, rgba(5, 5, 5, 0.08), transparent 55%),
                linear-gradient(120deg, rgba(5, 5, 5, 0.03) 0%, rgba(131, 177, 214, 0.18) 50%, rgba(5, 5, 5, 0.03) 100%);
}

.products-hero-media {
    display: flex;
    justify-content: flex-end;
}

.products-hero-images {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: center;
}

.products-hero-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.products-card-layout {
    display: flex;
    gap: 1.5rem;
}

.products-card-media {
    flex-shrink: 0;
    width: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.products-card-stack {
    position: relative;
    width: 180px;
    height: 180px;
}

.products-card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.products-card-img--top {
    z-index: 2;
    transform: translateX(-35px);
}

.products-card-img--single {
    position: static;
    width: 100%;
    height: auto;
}

.products-card-body {
    flex: 1;
}

/* Xiphos features interactive - card highlight */
.xiphos-feature-card {
    cursor: pointer;
}
.xiphos-feature-card--active,
.xiphos-feature-card.xiphos-feature-card--active {
    border-color: #83b1d6 !important;
    background-color: rgba(131, 177, 214, 0.12) !important;
    box-shadow: 0 0 0 1px rgba(131, 177, 214, 0.3);
}
.xiphos-feature-card--active .text-gray-700 {
    color: #1e3a5f !important;
}

/* Xiphos feature image - all preloaded, fade between them */
.xiphos-feature-image {
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    pointer-events: none;
}
.xiphos-feature-image--active {
    opacity: 1;
    position: relative;
    z-index: 1;
}

.xiphos-dev-eth-media {
    max-width: 720px;
    margin: 0 auto;
}

.xiphos-dev-eth-media canvas {
    width: 100% !important;
    max-height: 480px;
    object-fit: contain;
}

.xiphos-dev-eth-copy {
    max-width: 520px;
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .products-card-layout {
        flex-direction: column;
        align-items: flex-start;
    }
    .products-card-media {
        width: 160px;
    }
    .products-card-stack {
        width: 160px;
        height: 160px;
    }
}

.products-hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #374151;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.products-hero-badge--phantom {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

@media (max-width: 1024px) {
    .products-hero-images {
        grid-template-columns: 1fr;
    }
}

/* XIPHOS hero image toggle */
.xiphos-hero-stack {
    position: relative;
    width: 100%;
    max-width: 360px;
    height: 0;
    padding-bottom: 100%;
    overflow: hidden;
}

@media (max-width: 480px) {
    .xiphos-hero-stack {
        max-width: 280px;
    }
}

.xiphos-hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.98);
    transition: opacity 300ms ease, transform 300ms ease;
    pointer-events: none;
}

.xiphos-hero-img.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.xiphos-toggle-btn.is-active {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.xiphos-toggle-btn--phantom.is-active {
    background: rgba(16, 185, 129, 0.35);
    color: #d1fae5;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.45);
}

/* XIPHOS hero procedural background */
.xiphos-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.6;
}

.xiphos-hero-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.xiphos-hero {
    background: linear-gradient(120deg, #0b1116 0%, #182734 45%, #2f4a62 75%, #4d6f8c 100%);
}

.home-hero {
    height: min(100vh, 920px);
    min-height: 500px;
}

@media (min-width: 640px) {
    .home-hero {
        min-height: 600px;
    }
}

@media (min-width: 1024px) {
    .home-hero {
        min-height: 680px;
    }
}

.home-hero-net {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 55%;
    z-index: 25;
    pointer-events: none;
    opacity: 0.6;
    mask-image: linear-gradient(to right, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 65%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: linear-gradient(to right, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 65%, rgba(0, 0, 0, 0) 100%);
}

.home-hero-net-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.home-hero-right {
    display: flex;
}

.home-xiphos {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    transform: translate(-16px, -20px);
}

.home-xiphos-stack {
    position: relative;
    width: clamp(260px, 28vw, 420px);
    height: clamp(260px, 28vw, 420px);
}

.home-xiphos-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.98);
    transition: opacity 300ms ease, transform 300ms ease;
    pointer-events: none;
}

.home-xiphos-img.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.home-xiphos-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 9999px;
    padding: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.home-xiphos-copy {
    max-width: 260px;
    margin-left: 1.25rem;
}

@media (min-width: 1024px) and (max-width: 1279px) {
    .home-hero .container {
        padding-left: 8rem;
        padding-right: 8rem;
    }
    .hero-left-shift {
        padding-left: 2.5rem;
    }
    .hero-iso.hero-left-shift {
        padding-left: 2.5rem;
    }
    .home-xiphos {
        transform: translate(-36px, -20px);
    }
    .home-xiphos-copy {
        margin-left: 0.75rem;
    }
}

@media (min-width: 1280px) {
    .home-hero {
        height: min(100vh, 860px);
        min-height: 640px;
    }
}

.home-hero-title {
    font-size: clamp(2.4rem, 3.4vw, 3.8rem) !important;
}

.home-hero-desc {
    font-size: clamp(0.95rem, 1.2vw, 1.2rem);
}

.home-xiphos-title {
    font-size: clamp(1.4rem, 2vw, 2.2rem);
}

.home-xiphos-sub {
    font-size: clamp(0.85rem, 1.1vw, 1rem);
}

.home-xiphos-tech {
    font-size: clamp(0.75rem, 0.9vw, 0.9rem);
}

.home-xiphos-btn {
    margin-top: 0.75rem;
    box-shadow: 0 10px 24px rgba(131, 177, 214, 0.25);
}

.careers-hero-wide {
    max-width: 1400px;
}

/* Home FAQ accordion - hide default marker so custom arrow shows */
#faq details summary::-webkit-details-marker {
    display: none;
}
#faq details summary::marker {
    content: none;
}

@media (max-width: 1024px) {
    .home-xiphos-stack {
        width: 280px;
        height: 280px;
    }
    .home-xiphos-copy {
        max-width: 220px;
        margin-left: 1rem;
    }
}

/* Mobile: stack hero sections vertically - avoid overlap */
@media (max-width: 768px) {
    .home-hero {
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding-top: 5rem;
        min-height: auto;
    }
    .hero-left-content {
        position: static !important;
        min-height: auto;
        height: auto;
        width: 100%;
        flex-shrink: 0;
        order: 1;
    }
    .hero-left-content .container {
        padding-top: 0.5rem;
    }
    .home-hero .hero-content {
        min-height: auto;
        padding-bottom: 1rem;
    }
    .hero-iso {
        margin-top: 0;
        padding: 1rem 0 1.5rem;
        order: 3;
    }
    .hero-iso-pill {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.65rem !important;
    }
    .home-hero .hero-iso {
        position: static !important;
        bottom: auto;
        width: 100%;
    }
    .hero-buttons {
        width: fit-content;
        max-width: 100%;
    }
    .hero-buttons a {
        flex-shrink: 0;
    }
    .home-hero-right {
        position: static !important;
        margin-top: 0;
        flex: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        padding-bottom: 0.5rem;
        order: 2;
    }
    .home-hero-right .container {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100%;
        max-width: 100%;
    }
    .home-xiphos {
        transform: none;
        flex-direction: column;
    }
    .home-xiphos-copy {
        margin-left: 0;
        margin-top: 1.25rem;
        text-align: center;
        background: transparent;
        padding: 0.75rem 1rem;
        border-radius: 0;
        border: none;
    }
    .home-xiphos-copy .home-xiphos-title {
        font-size: 1.125rem;
    }
    .home-xiphos-copy .home-xiphos-sub {
        font-size: 0.8125rem;
        margin-bottom: 0.5rem;
    }
    .home-xiphos-copy .home-xiphos-tech {
        font-size: 0.75rem;
        margin-bottom: 0.75rem;
    }
    .home-xiphos-copy .home-xiphos-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        width: auto;
        min-width: 0;
    }
    .home-xiphos-toggle {
        padding: 0.2rem;
        font-size: 0.7rem;
    }
    .home-xiphos-toggle .xiphos-toggle-btn {
        padding: 0.35rem 0.65rem;
    }
}

@media (max-width: 480px) {
    .home-xiphos-stack {
        width: min(240px, 85vw);
        height: min(240px, 85vw);
    }
    .home-hero-title {
        font-size: clamp(1.75rem, 6vw, 2.5rem) !important;
    }
}

.xiphos-cert-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(3, 8, 16, 0.35);
    min-width: 180px;
}

.xiphos-cert-card--side {
    min-width: 86px;
    max-width: 110px;
    margin-left: 0;
    margin-top: 2.5rem;
    min-height: 200px;
}

@media (min-width: 768px) {
    .xiphos-cert-card--side {
        margin-left: 2.1rem;
        min-height: 300px;
    }
}

.xiphos-hero-media {
    min-width: 0;
    width: 100%;
    max-width: 320px;
}

@media (min-width: 640px) {
    .xiphos-hero-media {
        min-width: 280px;
        max-width: 420px;
    }
}

.xiphos-toggle-wrap {
    justify-content: center;
}

.xiphos-cert-logo {
    width: 120px;
    height: auto;
    object-fit: contain;
    opacity: 0.9;
}

.xiphos-ce-logo {
    font-weight: 700;
    letter-spacing: 0.14em;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 9999px;
    padding: 0.35rem 0.7rem;
    background: rgba(255, 255, 255, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.xiphos-ce-img {
    width: 32px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.xiphos-cert-std {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 9999px;
    padding: 0.3rem 0.55rem;
    background: rgba(255, 255, 255, 0.06);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    line-height: 1;
}

/* ZENITH eMMC progression badges */
.emmc-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.75rem;
    line-height: 1.25rem;
}

.emmc-4 {
    background: rgba(156, 163, 175, 0.25);
    color: #6b7280;
}

.emmc-8 {
    background: rgba(59, 130, 246, 0.18);
    color: #3b82f6;
}

.emmc-16 {
    background: rgba(16, 185, 129, 0.18);
    color: #10b981;
}

.emmc-32 {
    background: rgba(239, 68, 68, 0.18);
    color: #ef4444;
}

/* ZENITH RAM progression badges */
.ram-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.75rem;
    line-height: 1.25rem;
}

.ram-1 {
    background: rgba(156, 163, 175, 0.25);
    color: #6b7280;
}

.ram-2 {
    background: rgba(156, 163, 175, 0.25);
    color: #6b7280;
}

.ram-4 {
    background: rgba(59, 130, 246, 0.18);
    color: #3b82f6;
}

.ram-6 {
    background: rgba(16, 185, 129, 0.18);
    color: #10b981;
}


@media (max-width: 1024px) {
    .hero-left-content {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        background: linear-gradient(135deg, rgba(5, 5, 5, 0.95) 0%, rgba(5, 5, 5, 0.92) 100%);
    }
}

.hero-right-carousel {
    clip-path: polygon(65% 0, 100% 0, 100% 100%, 50% 100%);
    min-height: 100vh;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Blue veil over hero images (right side) */
.hero-right-carousel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(5, 5, 5, 0.85) 0%, rgba(5, 5, 5, 0.75) 40%, rgba(5, 5, 5, 0.55) 65%, rgba(131, 177, 214, 0.18) 85%, rgba(5, 5, 5, 0.18) 100%);
    z-index: 12;
    pointer-events: none;
}

@media (max-width: 1024px) {
    .hero-right-carousel {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        opacity: 0.4;
    }
}

.hero-diagonal-mask {
    background: transparent;
    pointer-events: none;
    z-index: 15;
    width: 50%;
}

.hero-carousel-container {
    overflow: hidden;
    position: absolute;
    inset: 0;
}

/* Wrapper above ::after (z-12) so carousel photos are visible; overlays (z-15) on top to darken */
.hero-carousel-wrapper {
    position: absolute;
    inset: 0;
    z-index: 13;
}
.hero-carousel-container > .absolute {
    z-index: 15;
}

/* Darkening gradient over carousel images */
.hero-carousel-darkening {
    z-index: 14;
    background: linear-gradient(180deg,
        rgba(5, 5, 5, 0.55) 0%,
        rgba(5, 5, 5, 0.35) 40%,
        rgba(5, 5, 5, 0.25) 70%,
        rgba(5, 5, 5, 0.15) 100%);
}

.hero-carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
}

.hero-carousel-slide.active {
    opacity: 1;
    z-index: 2;
}

/* LCP: image discoverable in HTML; fill slide like background-image */
.hero-carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    filter: brightness(0.7) contrast(1.05);
}

/* ===== HOME BLOG CAROUSEL (4 tarjetas visibles, cada 5 s avanza una) ===== */
.home-blog-carousel-v2 {
    padding-left: 1rem;
    padding-right: 1rem;
}
.home-blog-carousel-inner {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
    border-radius: 1rem;
}
/* Cuántas tarjetas se ven a la vez: 1 móvil, 2 tablet, 4 desktop */
.home-blog-section { --blog-visible: 4; }
@media (max-width: 639px) {
    .home-blog-section { --blog-visible: 1; }
}
@media (min-width: 640px) and (max-width: 1023px) {
    .home-blog-section { --blog-visible: 2; }
}
@media (min-width: 1024px) {
    .home-blog-section { --blog-visible: 4; }
}
.home-blog-track-v2 {
    display: flex;
    width: calc(100% * var(--blog-count, 8) / var(--blog-visible, 4));
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}
.home-blog-card-v2 {
    flex: 0 0 calc(100% / var(--blog-count, 8));
    width: calc(100% / var(--blog-count, 8));
    padding: 0.25rem;
    box-sizing: border-box;
}
.home-blog-card-v2-link {
    text-decoration: none;
    color: inherit;
    min-height: 220px;
    display: flex;
    flex-direction: column;
}
.home-blog-card-v2-link:hover {
    color: inherit;
}
.home-blog-card-v2 .line-clamp-2,
.home-blog-card-v2 .line-clamp-3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.home-blog-card-v2 .line-clamp-2 { -webkit-line-clamp: 2; }
.home-blog-card-v2 .line-clamp-3 { -webkit-line-clamp: 3; }
.home-blog-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}
.home-blog-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: #cbd5e1;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
}
.home-blog-dot:hover {
    background: #94a3b8;
}
.home-blog-dot.active {
    background: var(--color-secondary, #83b1d6);
    transform: scale(1.25);
}

/* Blog listing page cards */
.blog-listing-card .line-clamp-2,
.blog-listing-card .line-clamp-3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-listing-card .line-clamp-2 { -webkit-line-clamp: 2; }
.blog-listing-card .line-clamp-3 { -webkit-line-clamp: 3; }

/* Blog: destacado dentro del hero — rectángulo apaisado (más ancho que alto), foto izq, contenido der */
.blog-hero-featured {
    aspect-ratio: 2 / 1;
    max-width: 48rem;
    display: block;
}
.blog-hero-featured > div {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 0;
    height: 100%;
    width: 100%;
    min-height: 0;
}
.blog-hero-featured > div > div:first-child {
    min-height: 0;
    overflow: hidden;
}
.blog-hero-featured > div > div:first-child img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.blog-hero-featured .line-clamp-2 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

/* ===== HOME SOLUTIONS SECTION (two columns: intro + 2x2 cards) ===== */
.home-solutions {
    color: #111827;
}
.home-solutions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem 3rem;
    align-items: start;
    max-width: 1280px;
    margin: 0 auto;
}
@media (min-width: 1024px) {
    .home-solutions-grid {
        grid-template-columns: 1fr 1.2fr;
        gap: 3rem 4rem;
    }
}
.home-solutions-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-secondary, #83b1d6);
    margin-bottom: 0.75rem;
}
.home-solutions-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: #050505;
    margin: 0 0 1.25rem;
}
@media (min-width: 768px) {
    .home-solutions-title {
        font-size: 2.25rem;
    }
}
.home-solutions-text {
    font-size: 1rem;
    line-height: 1.65;
    color: #4b5563;
    margin: 0 0 1rem;
}
.home-solutions-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #fff;
    background: #050505;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}
.home-solutions-cta:hover {
    background: #1f2937;
    transform: translateY(-1px);
}
.home-solutions-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 500px) {
    .home-solutions-cards {
        grid-template-columns: 1fr 1fr;
        gap: 1.25rem;
    }
}
.home-solutions-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.home-solutions-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #d1d5db;
    transform: translateY(-2px);
}
.home-solutions-card-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    color: var(--color-secondary, #83b1d6);
    flex-shrink: 0;
}
.home-solutions-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #050505;
    margin: 0 0 0.5rem;
    line-height: 1.3;
}
.home-solutions-card-desc {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #4b5563;
    margin: 0 0 1rem;
    flex-grow: 1;
}
.home-solutions-card-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-secondary, #83b1d6);
}
.home-solutions-card:hover .home-solutions-card-link {
    text-decoration: underline;
}

/* Ensure hero section takes full viewport height */
section.relative.min-h-screen {
    min-height: 100vh;
    padding-top: 0;
    padding-bottom: 0;
}

/* ===== BLOG ARTICLE PAGE – Redesign ===== */
.blog-page-main {
    background: linear-gradient(160deg, #f8fafc 0%, #f1f5f9 35%, #e2e8f0 100%);
    padding-bottom: 3rem;
}

.blog-breadcrumb {
    max-width: 80rem;
    margin: 0 auto 1.5rem;
    font-size: 0.875rem;
    color: #64748b;
}
.blog-breadcrumb a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s;
}
.blog-breadcrumb a:hover {
    color: var(--color-secondary, #83b1d6);
}
.blog-breadcrumb [aria-current="page"] {
    color: #0f172a;
    font-weight: 500;
}

/* Single card wrapping article – wider layout */
.blog-article-card {
    max-width: 80rem;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 10px 20px -5px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.blog-article {
    color: #374151;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Header: accent bar + two columns (text left, image right) */
.blog-article-header {
    background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
    padding: 2rem 1.75rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
}
.blog-article-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-secondary, #83b1d6) 0%, var(--color-primary, #1e3a5f) 100%);
}
.blog-article-header-inner {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
@media (min-width: 768px) {
    .blog-article-header {
        padding: 2.25rem 2.5rem 2rem;
    }
    .blog-article-header-inner {
        flex-direction: row;
        align-items: flex-start;
        gap: 2.5rem;
    }
    .blog-article-header-text {
        flex: 1;
        min-width: 0;
    }
    .blog-article-header-image {
        flex-shrink: 0;
        width: 280px;
        max-width: 40%;
    }
    .blog-article-header-image picture,
    .blog-article-header-image img {
        display: block;
        width: 100%;
        height: auto;
        max-height: 220px;
        object-fit: cover;
        border-radius: 12px;
        border: 1px solid #e5e7eb;
    }
}
@media (min-width: 1024px) {
    .blog-article-header {
        padding: 2.5rem 3rem 2.25rem;
    }
    .blog-article-header-image {
        width: 320px;
    }
    .blog-article-header-image img {
        max-height: 240px;
    }
}
/* Mobile: image below text, restrained size */
@media (max-width: 767px) {
    .blog-article-header-image {
        max-width: 240px;
        margin: 0 auto;
    }
    .blog-article-header-image img {
        width: 100%;
        height: auto;
        max-height: 200px;
        object-fit: cover;
        border-radius: 12px;
    }
}
.blog-article-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-secondary, #83b1d6);
    margin-bottom: 0.75rem;
}
.blog-article-title {
    font-size: 1.875rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.75rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
@media (min-width: 768px) {
    .blog-article-title {
        font-size: 2.25rem;
    }
}
.blog-article-subtitle {
    font-size: 1.0625rem;
    font-weight: 400;
    color: #64748b;
    margin: 0;
    line-height: 1.6;
}

/* Body: generous padding, readable line length */
.blog-article-body {
    padding: 2rem 1.75rem 2.5rem;
    font-size: 1.0625rem;
    line-height: 1.8;
}
@media (min-width: 768px) {
    .blog-article-body {
        padding: 2.5rem 3rem 3rem;
    }
}
.blog-article-body p {
    margin: 0 0 1.35em;
    color: #334155;
}
.blog-article-body p:last-child {
    margin-bottom: 0;
}
.blog-article-body h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 2.25rem 0 0.85rem;
    padding-top: 1.75rem;
    padding-left: 1rem;
    border-left: 4px solid var(--color-secondary, #83b1d6);
    border-top: 1px solid #e2e8f0;
    line-height: 1.35;
}
.blog-article-body h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.blog-article-body h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin: 1.5rem 0 0.5rem;
    line-height: 1.35;
}
.blog-article-body ul {
    margin: 1.25em 0;
    padding-left: 1.5em;
    list-style-type: disc;
}
.blog-article-body li {
    margin-bottom: 0.5em;
}

/* Imágenes insertadas en el cuerpo: tamaño de párrafo, alineación izquierda/derecha */
.blog-article-body .blog-inline-image-wrap {
    display: block;
    line-height: 0;
}
.blog-article-body .blog-inline-image-wrap.blog-inline-image-left {
    float: left;
    margin: 0 1.25rem 1rem 0;
}
.blog-article-body .blog-inline-image-wrap.blog-inline-image-right {
    float: right;
    margin: 0 0 1rem 1.25rem;
}
.blog-article-body .blog-inline-image {
    max-height: 200px;
    width: auto;
    max-width: 280px;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    vertical-align: middle;
}
@media (min-width: 768px) {
    .blog-article-body .blog-inline-image {
        max-height: 220px;
        max-width: 320px;
    }
}
/* Limpiar float después de párrafos que siguen a imágenes flotadas */
.blog-article-body h2,
.blog-article-body h3,
.blog-article-body ul {
    clear: both;
}

.blog-article-body strong {
    font-weight: 600;
    color: #1e293b;
}
.blog-article-body a {
    color: var(--color-secondary, #83b1d6);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
}
.blog-article-body a:hover {
    text-decoration: none;
    color: var(--color-primary, #1e3a5f);
}
.blog-article-placeholder {
    color: #64748b;
    font-style: italic;
    margin: 0;
}

/* Footer: two links */
.blog-article-footer {
    padding: 1.5rem 1.75rem;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
}
@media (min-width: 768px) {
    .blog-article-footer {
        padding: 1.5rem 3rem;
    }
}
.blog-article-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-secondary, #83b1d6);
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: color 0.2s;
}
.blog-article-back:hover {
    color: var(--color-primary, #1e3a5f);
    text-decoration: underline;
}
.blog-article-back-secondary {
    color: #64748b;
}
.blog-article-back-secondary:hover {
    color: #0f172a;
}

/* ===== SERVICES PAGE ===== */
.services-hero {
    min-height: 28rem;
}
.services-hero-net {
    position: absolute;
    inset: 0;
    z-index: 12;
    pointer-events: none;
    opacity: 0.85;
}
.services-hero-net-canvas {
    width: 100%;
    height: 100%;
    display: block;
}
@media (min-width: 768px) {
    .services-hero {
        min-height: 32rem;
    }
}
/* Tarjetas de servicios: estilo referencia – blanco, sombra muy suave, icono outline en recuadro azul, "Ver →" */
.services-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.75rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.25s ease, transform 0.2s ease;
}
.services-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.services-card-icon-wrap {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 10px;
    background: rgba(131, 177, 214, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}
.services-card-icon {
    width: 1.75rem;
    height: 1.75rem;
    color: var(--color-secondary, #83b1d6);
}
.services-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #374151;
    margin: 0 0 0.75rem;
    line-height: 1.3;
    transition: color 0.2s ease;
}
.services-card:hover .services-card-title {
    color: var(--color-secondary, #83b1d6);
}
.services-card-desc {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #4b5563;
    margin: 0 0 1rem;
}
.services-card-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-secondary, #83b1d6);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: gap 0.2s ease;
}
.services-card:hover .services-card-link {
    gap: 0.35rem;
}
@media (min-width: 768px) {
    .services-card {
        padding: 2rem 1.75rem;
    }
    .services-card-icon-wrap {
        width: 4rem;
        height: 4rem;
        margin-bottom: 1.5rem;
    }
    .services-card-icon {
        width: 2rem;
        height: 2rem;
    }
}
.services-process-step {
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.services-process-step:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 4px 10px -2px rgba(0, 0, 0, 0.04);
    border-color: rgba(131, 177, 214, 0.3);
}
@media (min-width: 1024px) {
    .services-process {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
    }
}
