/* Navbar hide/show */
.navbar {
    transition: transform .25s ease, background-color .2s ease;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 80px;
    background: #dcd4cb;
    /* default: beige claro */
}

.navbar--hidden {
    transform: translateY(-100%);
}

/* Logo en navbar - ajustar tamaño en móvil */
.navbar img[alt="Quiroga Abogados"] {
    height: 3.5rem;
    /* h-14 */
}

@media (max-width: 768px) {
    .navbar img[alt="Quiroga Abogados"] {
        height: 2.5rem;
        /* h-10 para móviles */
    }
}

/* Dropdown menu base + show (Tailwind helpers usados en HTML; aquí refuerzo) */
.dropdown-menu.hidden {
    display: none !important;
}

.dropdown-menu {
    transition: opacity .22s ease, transform .22s ease;
    transform-origin: top left;
    background-color: #dcd4cb !important;
    border-radius: 0.5rem !important;
    opacity: 1 !important;
}

.dropdown-menu.show {
    display: block !important;
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
}

/* Sidebar (use transform for smoother mobile behavior) */
#sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    width: 320px !important;
    background-color: #dcd4cb !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1) !important;
    transform: translateX(-100%) !important;
    transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.2, 1), background-color 0.3s ease !important;
    z-index: 60 !important;
    overflow-y: auto;
}

#sidebar.sidebar--open {
    transform: translateX(0) !important;
}

/* Modo oscuro del sidebar */
#sidebar.sidebar--dark {
    background-color: rgba(42, 47, 54, 0.95) !important;
    backdrop-filter: blur(10px) !important;
}

/* En móviles muy pequeños (Galaxy S8+, ~360px), reducir ancho del sidebar */
@media (max-width: 480px) {
    #sidebar {
        width: 280px !important;
    }
}

/* Overlay */
#sidebarOverlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.4) !important;
    z-index: 40 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease !important;
}

#sidebarOverlay.hidden {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

#sidebarOverlay.overlay--visible {
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Prevent page scroll when sidebar open */
.no-scroll {
    overflow: hidden !important;
}

/* Dropdown items */
.dropdown__item {
    display: block;
    padding: .5rem .5rem;
    border-radius: .5rem;
    color: #111827;
}

/* Nav link styles and states */
.nav__link {
    color: #2a2f36;
    /* primary-dark */
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    transition: color .2s ease, background-color .2s ease;
}

/* When navbar sits on top of the hero (dark background) */
.navbar--on-hero {
    background: #2a2f36 !important;
    /* solid dark so it stands out */
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.navbar--on-hero .nav__link {
    color: #ffffff !important;
}

/* Ensure CTA buttons in navbar are solid and visible */
.navbar .inline-flex.bg-primary {
    background: #778cab !important;
    color: #ffffff !important;
}

/* Make sure dropdown background adapts when navbar is on hero */
.navbar--on-hero .dropdown-menu {
    background: #ffffff;
    /* show white dropdown over dark header */
    color: #2a2f36;
}

/* Utility to ensure primary color works even if Tailwind output wasn't rebuilt */
.bg-primary {
    background-color: #778cab !important;
    color: #ffffff !important;
}

.hover\:bg-accent:hover {
    background-color: #919faa !important;
}

/* Button reset to avoid transparent look where specificity causes issues */
.btn,
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .65rem 1rem;
    border-radius: .5rem;
    font-weight: 600;
    background-color: #778cab;
    color: #fff;
    border: none;
}

/* Responsive tweaks */
@media (max-width: 1024px) {

    /* Hide nav items and CTA on tablet/mobile */
    .navbar nav.hidden.lg\:flex,
    .navbar>div>.hidden.lg\:flex {
        display: none !important;
    }

    /* Ensure hamburger button is visible on tablet and below */
    #openSidebar {
        display: block !important;
        padding: 0.5rem;
        margin: 0;
        cursor: pointer;
        background: none !important;
        border: none !important;
        z-index: 51;
        position: relative;
        outline: none;
    }

    #openSidebar:focus {
        outline: 2px solid #778cab;
        outline-offset: 2px;
    }

    #openSidebar svg {
        width: 2rem;
        height: 2rem;
        color: #2a2f36;
        stroke-width: 2;
        transition: color 0.2s ease;
    }

    .navbar--on-hero #openSidebar svg {
        color: #ffffff;
    }
}

/* Desktop (lg y mayor): ocultar hamburguesa */
@media (min-width: 1025px) {
    #openSidebar {
        display: none !important;
    }
}

@media (max-width: 768px) {

    /* Reduce hero text size on small screens */
    .hero-title {
        font-size: 2rem;
    }

    .navbar .max-w-7xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    #openSidebar {
        display: block !important;
    }
}

/* Móviles pequeños (Galaxy S8+, ~360px y menores) */
@media (max-width: 480px) {
    .navbar {
        height: 70px !important;
    }

    #openSidebar svg {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }

    .hero-title {
        font-size: 1.75rem !important;
    }

    /* Ajustar margin-top del hero según el nuevo alto del navbar */
    section.relative {
        margin-top: 70px !important;
    }
}

.dropdown__item:hover {
    background: #f8fafc;
}

/* Sidebar link styles */
.sidebar__link {
    display: block;
    padding: 0.75rem;
    color: #2a2f36;
    font-weight: 500;
    transition: background-color .2s ease, color .2s ease;
    border-radius: 0.375rem;
}

.sidebar__link:hover {
    background-color: rgba(119, 138, 171, 0.1);
    color: #778cab;
}

.sidebar__sublink {
    display: block;
    padding: 0.5rem 0;
    color: #2a2f36;
    font-size: 0.95rem;
    font-weight: 400;
    transition: color .2s ease;
}

.sidebar__sublink:hover {
    color: #778cab;
}

.sidebar__summary {
    color: #2a2f36;
    font-weight: 500;
}

.sidebar__summary:hover {
    background-color: rgba(119, 138, 171, 0.1);
    border-radius: 0.375rem;
}

.sidebar__btn {
    background-color: #778cab !important;
    color: #ffffff !important;
    padding: 0.75rem 1rem !important;
    border-radius: 0.5rem !important;
    font-weight: 500 !important;
    transition: background-color .2s ease !important;
}

.sidebar__btn:hover {
    background-color: #919faa !important;
}

/* Modo oscuro para sidebar */
.sidebar--dark .sidebar__link {
    color: #dcd4cb;
}

.sidebar--dark .sidebar__link:hover {
    background-color: rgba(220, 212, 203, 0.1);
    color: #dcd4cb;
}

.sidebar--dark .sidebar__sublink {
    color: #dcd4cb;
}

.sidebar--dark .sidebar__sublink:hover {
    color: #dcd4cb;
}

.sidebar--dark .sidebar__summary {
    color: #dcd4cb;
}

.sidebar--dark .sidebar__summary:hover {
    background-color: rgba(220, 212, 203, 0.1);
}

/* Sidebar details summary arrow rotate */
.sidebar__details summary {
    list-style: none;
}

.sidebar__details summary::-webkit-details-marker {
    display: none;
}

.sidebar__details[open] summary i {
    transform: rotate(180deg);
    transition: transform .25s ease;
}

.service-card {
    overflow: hidden;
    background: white;
}

/* Fondo con imagen (hidden por defecto) */
.service-card__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

/* Contenido visible encima del fondo */
.service-card__content {
    background: white;
    transition: background 0.4s ease, color 0.4s ease;
}

/* Efecto hover: mostrar fondo de imagen */
.service-card:hover .service-card__bg {
    opacity: 0.15;
}

/* Efecto hover: oscurecer el contenido */
.service-card:hover .service-card__content {
    background: rgba(255, 255, 255, 0.95);
}

/* Animación de elevación y sombra */
.service-card:hover {
    transform: translateY(-8px);
}

/* Estilo para los textos dentro de la tarjeta */
.service-card h3 {
    transition: color 0.3s ease;
}

.service-card:hover h3 {
    color: #778cab;
}

/* Animación del enlace "Más información" */
.service-card a {
    transition: all 0.3s ease;
}

.service-card:hover a {
    gap: 0.75rem;
}

.service-card:hover a i {
    transform: translateX(3px);
}

/* Responsive */
@media (max-width: 768px) {
    .service-card {
        transform: translateY(0) !important;
    }

    .service-card:hover {
        transform: translateY(-4px);
    }
}

/* ============================= */
/* FRAME-IT: Image Placeholder Frames */
/* ============================= */

/* Frame base style - shows as placeholder until real image loads */
.frame-it {
    position: relative;
    background: linear-gradient(135deg, #f5f5f5 0%, #e9e9e9 50%, #f5f5f5 100%);
    background-size: 200% 200%;
    animation: shimmer 2s infinite;
    border: 3px dashed #778cab;
    box-shadow: inset 0 0 0 2px #dcd4cb, 0 0 20px rgba(119, 138, 171, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #999;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    padding: 1.5rem;
}

/* Shimmer animation */
@keyframes shimmer {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* When a real image src is loaded, remove the frame styling */
.frame-it[src]:not([src=""]) {
    animation: none;
    background: none;
    border: none;
    box-shadow: none;
    color: transparent;
    font-size: 0;
    padding: 0;
    min-height: auto;
}

/* Fallback: if image loads but data attribute shows it's loaded, style removes automatically */
img.frame-it {
    transition: all 0.3s ease;
}

img.frame-it:not(:invalid) {
    border: none;
    box-shadow: none;
}

/* ============================= */
/* FOOTER STYLING */
/* ============================= */

footer {
    background-color: #2a2f36 !important;
    color: #919faa !important;
}

footer h3 {
    color: #ffffff !important;
}

footer .footer__link {
    color: #919faa;
    transition: color 0.2s ease;
}

footer .footer__link:hover {
    color: #778cab;
}

footer a {
    color: #919faa;
    transition: color 0.2s ease;
}

footer a:hover {
    color: #778cab;
}

footer .border-border\/30 {
    border-color: rgba(88, 89, 91, 0.3);
}

footer .text-secondary\/60 {
    color: rgba(121, 126, 132, 0.6);
}

/* ============================= */
/* SOFT SHADOW EFFECT ON HERO TEXT */
/* ============================= */

/* Hero h1 con shadow suave */
section.relative h1 {
    text-shadow: 0px 4px 8px rgba(0, 0, 0, 0.5);
}

/* Hero p con shadow suave */
section.relative p {
    text-shadow: 0px 3px 6px rgba(0, 0, 0, 0.4);
}

/* ============================= */
/* HERO BACKGROUND IMAGE BLUR */
/* ============================= */

/* Blur ligero en la imagen de hero */
section.relative>img {
    filter: blur(2px);
}