/* =============================================================
   Saneamiento y Judicial Page
   Tema Piedrangular

   CSS namespace: .san-*
   Mirrors the layout system of maquinarias-page.css and tasaciones-page.css
   with proper per-page scoping. All structural rules are identical; only the
   class prefix differs.

   Sections:
     1. Banner            (.san-banner)
     2. Page wrapper      (.san-page-wrapper)
     3. Page layout grid  (.san-page-layout)
     4. Service cards     (.san-service-card / .san-detail-box)
     5. Sidebar           (.san-sidebar)
     6. Sidebar form      (.san-sidebar-form)
     7. Responsive
   ============================================================= */


/* =============================================================
   1. BANNER
   ============================================================= */

.san-banner {
    position: relative;
    min-height: 480px;
    background-color: var(--color-navy, #0a1f3d);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
}

.san-banner__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        rgba(5, 18, 46, 0.88) 0%,
        rgba(5, 18, 46, 0.65) 55%,
        rgba(5, 18, 46, 0.45) 100%
    );
    z-index: 1;
    pointer-events: none;
}

.san-banner__inner {
    position: relative;
    z-index: 2;
    padding: 96px 0 72px;
}

.san-banner__title {
    font-size: clamp(2.25rem, 6vw, 4rem);
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.1;
    margin: 0 0 28px;
}

.san-banner__breadcrumb {
    display: inline-block;
    background-color: var(--color-navy, #0a1f3d);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 11px 22px;
    line-height: 1;
}


/* =============================================================
   2. PAGE WRAPPER
   ============================================================= */

.san-page-wrapper {
    background-color: #eef1f8;
    padding: clamp(40px, 6vw, 64px) 0 clamp(60px, 8vw, 100px);
}


/* =============================================================
   3. PAGE LAYOUT GRID
   ============================================================= */

.san-page-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: clamp(24px, 3vw, 40px);
    align-items: start; /* Required for position: sticky on sidebar */
}


/* =============================================================
   4. SERVICE CARDS
   ============================================================= */

.san-content {
    display: flex;
    flex-direction: column;
    gap: clamp(24px, 3vw, 36px);
    min-width: 0;
}

.san-service-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(10, 31, 61, 0.08);
    overflow: hidden;
    scroll-margin-top: 130px;
}

.san-service-card__image-wrap {
    width: 100%;
    overflow: hidden;
}

.san-service-card__image {
    width: 100%;
    height: clamp(220px, 28vw, 380px);
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.san-service-card:hover .san-service-card__image {
    transform: scale(1.02);
}

.san-service-card__image-wrap--placeholder {
    height: clamp(180px, 22vw, 300px);
    background: linear-gradient(135deg, #d9e4f5 0%, #b8cdf0 100%);
}

.san-service-card__body {
    padding: clamp(24px, 3vw, 36px);
}

.san-service-card__title {
    font-size: clamp(1.25rem, 2.5vw, 1.625rem);
    font-weight: 800;
    color: var(--color-primary, #1a4ddb);
    line-height: 1.3;
    margin: 0 0 16px;
    text-wrap: balance;
}

.san-service-card__desc {
    color: #444;
    font-size: 0.9375rem;
    line-height: 1.8;
    margin: 0 0 clamp(20px, 3vw, 28px);
}

/* Two-column detail blocks */
.san-service-card__details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(12px, 2vw, 20px);
}

.san-detail-box {
    background-color: var(--color-section-blue, #1a3a99);
    border-radius: 6px;
    padding: clamp(16px, 2.5vw, 24px) clamp(14px, 2vw, 20px);
}

.san-detail-box__heading {
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 700;
    margin: 0 0 14px;
    line-height: 1.3;
}

.san-detail-box__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.san-detail-box__list li {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.8125rem;
    line-height: 1.6;
    padding-left: 16px;
    position: relative;
}

.san-detail-box__list li::before {
    content: '•';
    position: absolute;
    left: 0;
    top: 0;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
}


/* =============================================================
   5. SIDEBAR
   ============================================================= */

.san-sidebar {
    position: sticky;
    top: 120px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 1.5vw, 16px);
    min-width: 0;
    padding-bottom: 24px;
    scrollbar-width: thin;
    scrollbar-color: rgba(26, 77, 219, 0.25) transparent;
}

.san-sidebar::-webkit-scrollbar {
    width: 4px;
}

.san-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.san-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(26, 77, 219, 0.25);
    border-radius: 4px;
}

/* Generic sidebar box */
.san-sidebar__box {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 14px rgba(10, 31, 61, 0.08);
    overflow: clip;
}

.san-sidebar__box-title {
    font-size: 0.9375rem;
    font-weight: 800;
    color: var(--color-primary, #1a4ddb);
    margin: 0;
    padding: 14px 16px 11px;
    border-bottom: 1px solid #eef1f8;
}

/* ---- Nav box ---- */
.san-sidebar__box--nav nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px 10px 10px;
}

.san-nav__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background-color: var(--color-primary, #1a4ddb);
    border-radius: 8px;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    padding: 9px 12px 9px 14px;
    transition: background-color 0.2s ease;
}

.san-nav__link:hover,
.san-nav__link:focus-visible {
    background-color: var(--color-primary-hover, #1540c0);
    outline: none;
    color: #fff;
}

.san-nav__link.is-active {
    background-color: var(--color-navy, #061539);
}

.san-nav__label {
    flex: 1;
    word-break: break-word;
}

.san-nav__chevron {
    flex-shrink: 0;
    align-self: center;
    display: block;
    width: 22px;
    height: 22px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 6px;
}

/* ---- Downloads box ---- */
.san-download__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    text-decoration: none;
    color: var(--color-primary, #1a4ddb);
    font-size: 0.875rem;
    font-weight: 700;
    border-bottom: 1px solid #eef1f8;
    transition: background-color 0.18s ease;
    cursor: pointer;
}

.san-download__link:last-child {
    border-bottom: none;
}

.san-download__link:hover:not(.san-download__link--disabled),
.san-download__link:focus-visible:not(.san-download__link--disabled) {
    background-color: #f5f7ff;
    outline: none;
}

.san-download__link--disabled {
    opacity: 0.45;
    cursor: default;
}

.san-download__icon {
    flex-shrink: 0;
    color: #e04040;
}

.san-download__label {
    flex: 1;
}

.san-download__arrow {
    flex-shrink: 0;
    color: var(--color-primary, #1a4ddb);
    opacity: 0.7;
}


/* =============================================================
   6. SIDEBAR FORM
   ============================================================= */

.san-sidebar-form {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    padding: clamp(14px, 2vw, 20px) clamp(16px, 2vw, 20px) clamp(16px, 2vw, 22px);
}

.san-sidebar-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.san-sidebar-form__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1rem;
    background-color: #25a244;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 0.125rem;
}

.san-sidebar-form__submit:hover {
    background-color: #1e8c3a;
}

.san-sidebar-form__submit:focus-visible {
    outline: 3px solid rgba(37, 162, 68, 0.4);
    outline-offset: 2px;
}

/* form-field__* component styles come from the global contact.css */


/* =============================================================
   7. RESPONSIVE
   ============================================================= */

@media (max-width: 1100px) {
    .san-page-layout {
        grid-template-columns: 1fr 320px;
    }
}

@media (max-width: 900px) {
    .san-page-layout {
        grid-template-columns: 1fr;
    }

    .san-sidebar {
        position: static;
        top: auto;
        max-height: none;
        overflow-y: visible;
        padding-bottom: 0;
    }

    .san-service-card__image {
        height: clamp(200px, 40vw, 320px);
    }
}

@media (max-width: 560px) {
    .san-service-card__details {
        grid-template-columns: 1fr;
    }

    .san-sidebar-form__row {
        grid-template-columns: 1fr;
    }

    .san-service-card__body {
        padding: 20px 16px 24px;
    }
}

@media (max-width: 400px) {
    .san-banner__title {
        font-size: 1.875rem;
    }
}
