/* CSS for Legal Pages (Aviso Legal, Política de Cookies, etc.) */

/* Header Section */
.legal-page-header {
    background: #FFF8F8;
    padding: 60px 0;
    /* Adjust padding as needed for visual balance */
    margin-bottom: 50px;
    /* Space between header and content */
}

@media (max-width: 768px) {
    .legal-page-header {
        margin-bottom: 30px;
        padding: 40px 0;
    }
}

.legal-page-header .dh-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    /* Aligned to left/start as requested */
}

.legal-page-header h1 {
    color: var(--primary-black-100, #111B29);
    font-family: Lato, sans-serif;
    font-size: 42px;
    font-style: normal;
    font-weight: 700;
    line-height: 116%;
    /* 48.72px */
    margin: 0;
}

/* Specific strict width for Privacy Policy header inner content */
.privacy-header-inner {
    max-width: 1050px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    /* Padded by dh-container, no extra padding needed */
}

.legal-page-section-title {
    margin-bottom: 20px;
    /* "a 20px del primer acordion" */
    margin-top: 0px;

    /* Align with accordion wrapper */
    max-width: 1050px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    /* Padded by dh-container parent, no extra needed */
}

/* Remove old overrides that caused the issue */
@media (min-width: 1090px) {
    /* No special overrides needed now that structural nesting handles standard container behavior */
}

.legal-page-description {
    color: var(--primary-black-100, #111B29);
    font-family: Lato, sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 132%;
    /* 21.12px */
    margin-top: 20px;
    max-width: 800px;
    /* Optional: limit width for better readability if needed */
}

.legal-section-separator {
    border: 0;
    height: 1px;
    background-color: var(--primary-red-100, #DF002F);
    margin: 50px auto;
    /* Centered with vertical spacing */
    max-width: 1050px;
    width: 100%;
}

/* Content Blocks */
.legal-page-block {
    margin-bottom: 30px;
    /* 30px spacing between content blocks */
}

.legal-page-block:last-child {
    margin-bottom: 80px;
}

@media (max-width: 768px) {
    .legal-page-block:last-child {
        margin-bottom: 60px;
    }
}

/* Headings (H3 as requested for titles) */
.legal-page-content h3 {
    color: var(--primary-red-100, #DF002F);
    font-family: Lato, sans-serif;
    font-size: 24px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    margin-bottom: 20px;
    /* 20px between title and text */
    margin-bottom: 20px;
    /* 20px between title and text */
}

/* Links */
.legal-page-content a {
    color: var(--primary-black-100, #111B29);
    text-decoration: underline;
    text-decoration-skip-ink: none;
}

.legal-page-content a:hover {
    text-decoration: none;
    /* Optional: Remove underline on hover if standard behavior is desired, usually good UX */
    color: var(--primary-red-100, #DF002F);
    /* Optional: Interaction state */
}

/* Paragraphs / Body Text */
.legal-page-content p,
.legal-page-content li {
    color: var(--primary-black-100, #111B29);
    font-family: Lato, sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 132%;
    /* 21.12px */
    margin-bottom: 10px;
    /* Standard spacing between paragraphs within a block */
}

.legal-page-content p:last-child,
.legal-page-content li:last-child {
    margin-bottom: 0;
    /* Remove margin from last paragraph in the block */
}

/* Lists */
.legal-page-content ul,
.legal-page-content ol {
    margin-bottom: 20px;
    padding-left: 20px;
}

.legal-page-content li {
    margin-bottom: 10px;
    list-style-type: disc;
    /* Default for UL, OL will override */
}

.legal-page-content ol li {
    list-style-type: decimal;
}

/* Cookie Policy Table Styles */
.cookie-table-category {
    background: var(--Secondary-Light-Red, #FCE7E8);
    color: var(--primary-black-100, #111B29);
    font-family: Lato, sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 142%;
    /* 25.56px */
    padding: 10px 18px;
    margin-bottom: 0;
    min-width: 700px;
    /* Ensure it scrolls with table */
    width: 100%;
    box-sizing: border-box;
}

.legal-page-table-wrapper {
    margin-top: 0;
    margin-bottom: 0;
    overflow-x: auto;
    /* Enable horizontal scroll */
}

.legal-page-table-wrapper:first-of-type {
    margin-top: 20px;
}

.legal-page-table-wrapper table {
    width: 100%;
    min-width: 700px;
    /* Force scroll on smaller screens */
    border-collapse: collapse;
    margin-bottom: 0;
    /* Requested spacing */
    table-layout: fixed;
    /* Ensures column widths are respected */
}

.legal-page-table-wrapper th {
    background: var(--primary-grey-20, #F7F8FA);
    color: var(--primary-black-100, #111B29);
    font-family: Lato, sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    padding: 10px 8px;
    /* Vertical padding 10px, Horizontal matches design visually */
    height: 40px;
    text-align: left;
    border: none;
    vertical-align: middle;
}

.legal-page-table-wrapper td {
    border-bottom: 1px solid var(--primary-grey-60, #E3E7EF);
    color: var(--primary-black-100, #111B29);
    font-family: Lato, sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 132%;
    /* 21.12px */
    padding: 14px 8px;
    vertical-align: top;
    word-wrap: break-word;
    /* Prevent overlapping */
    overflow-wrap: break-word;
}

/* Specific Column Widths based on Figma visual analysis */
.legal-page-table-wrapper th:nth-child(1),
.legal-page-table-wrapper td:nth-child(1) {
    width: 13%;
    /* Propiedad */
}

.legal-page-table-wrapper th:nth-child(2),
.legal-page-table-wrapper td:nth-child(2) {
    width: 20%;
    /* Cookie */
}

.legal-page-table-wrapper th:nth-child(3),
.legal-page-table-wrapper td:nth-child(3) {
    width: 52%;
    /* Finalidad */
}

.legal-page-table-wrapper th:nth-child(4),
.legal-page-table-wrapper td:nth-child(4) {
    width: 15%;
    /* Plazo */
}

/* =========================================
   Legal Accordion Styles
   Adapted from dh-complementos
   ========================================= */

/* =========================================
   Base Complementos Styles (Replicated)
   Required for structure to work
   ========================================= */

.dh-complementos__accordion-wrapper {
    width: 100%;
}

.dh-complementos__accordion {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dh-complementos__item {
    background: #F7F8FA;
    border-radius: 10px;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

.dh-complementos__header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 14px;
    background: transparent;
    border: none;
    /* Critical: Removes button border */
    cursor: pointer;
    text-align: left;
    gap: 16px;
    transition: opacity 0.3s ease;
}

.dh-complementos__item-title {
    font-family: 'Lato', sans-serif;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--primary-black-100, #111B29);
    margin: 0;
    transition: color 0.3s ease;
}

.dh-complementos__icon {
    flex-shrink: 0;
    width: 20px;
    height: 21px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s ease-in-out;
}

.dh-complementos__body {
    display: grid;
    grid-template-rows: 0fr;
    visibility: hidden;
    height: 0;
    opacity: 0;
    overflow: hidden;
    transition: grid-template-rows 0.8s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.8s step-end, opacity 0.8s ease, height 0.8s step-end;
}

.dh-complementos__item--active .dh-complementos__body {
    grid-template-rows: 1fr;
    visibility: visible;
    height: auto;
    opacity: 1;
    transition: grid-template-rows 0.8s cubic-bezier(0.25, 1, 0.5, 1), visibility 0s step-start, opacity 0.8s ease, height 0s step-start;
}

.dh-complementos__body-inner {
    padding: 0 30px;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    min-height: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: padding 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.5s ease, transform 0.5s ease, visibility 0.8s step-end;
}

.dh-complementos__item--active .dh-complementos__body-inner {
    padding-bottom: 20px;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: padding 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.8s ease 0.1s, transform 0.8s ease 0.1s, visibility 0s step-start;
}

/* Wrapper alignment and width */
.legal-accordion-overrides {
    max-width: 1050px;
    width: 100%;
    margin: 0 auto;
    /* Padded by dh-container parent */
}

.legal-accordion-overrides .dh-complementos__accordion {
    gap: 0;
    /* Flush items */
}

/* Item Overrides */
.legal-accordion-overrides .dh-complementos__item {
    background: var(--Primary-White, #FFF) !important;
    border: 2px solid var(--primary-red-5, #FFF3F3) !important;
    border-radius: 0 !important;
    margin-top: -2px;
    /* Collapse borders */
    position: relative;
}

/* Header Overrides */
.legal-accordion-overrides .dh-complementos__header {
    background: transparent !important;
    padding: 16px 22px !important;
    gap: 20px !important;
}

/* Margin bottom for last accordion wrapper as requested */
.legal-accordion-overrides:last-of-type {
    margin-bottom: 80px;
}

@media (max-width: 768px) {
    .legal-accordion-overrides:last-of-type {
        margin-bottom: 60px;
    }
}

.legal-accordion-overrides .dh-complementos__item-title {
    color: var(--primary-black-90, #29323E) !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 142% !important;
    margin-bottom: 0px !important;
}


/* First/Last Radius Logic */
.legal-accordion-overrides .dh-complementos__item:first-child {
    margin-top: 0;
    border-top-left-radius: 8px !important;
    border-top-right-radius: 8px !important;
}

.legal-accordion-overrides .dh-complementos__item:last-child {
    border-bottom-left-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
}

/* Active State Overrides */
.legal-accordion-overrides .dh-complementos__item--active,
.legal-accordion-overrides .dh-complementos__item:hover {
    background: var(--Secondary-White-red, #FFF8F8) !important;
    /* User requested hover match active */
    z-index: 10;
}

.legal-accordion-overrides .dh-complementos__item--active {
    background: var(--Secondary-White-red, #FFF8F8) !important;
    /* Borders match regular */
    border: 2px solid var(--primary-red-5, #FFF3F3) !important;
}

.legal-accordion-overrides .dh-complementos__item--active .dh-complementos__item-title {
    color: var(--primary-red-100, #DF002F) !important;
}

/* Icon Overrides */
.legal-accordion-overrides .dh-complementos__icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s ease-in-out;
}

.legal-accordion-overrides .dh-complementos__item--active .dh-complementos__icon {
    transform: rotate(180deg);
}

/* Icon filter for active state (red) */
.legal-accordion-overrides .dh-complementos__icon img,
.legal-accordion-overrides .dh-complementos__item--active .dh-complementos__icon-svg {
    transition: filter 0.3s ease;
}

.legal-accordion-overrides .dh-complementos__item--active .dh-complementos__icon img,
.legal-accordion-overrides .dh-complementos__item--active .dh-complementos__icon-svg {
    /* Filter to turn black to #DF002F (Primary Red) */
    filter: brightness(0) saturate(100%) invert(18%) sepia(86%) saturate(4645%) hue-rotate(342deg) brightness(96%) contrast(105%) !important;
}

/* Body Inner Overrides */
.legal-accordion-overrides .dh-complementos__body-inner {
    padding: 0 24px 24px !important;
}

/* Typography Overrides for Content */
.legal-accordion-overrides .dh-complementos__item-text p,
.legal-accordion-overrides p {
    color: var(--primary-black-100, #111B29);
    font-family: Lato, sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    margin-bottom: 8px;
}

.legal-accordion-overrides strong {
    font-weight: 700;
}

.legal-accordion-overrides a {
    color: var(--primary-black-100, #111B29);
    text-decoration: underline;
}

.legal-accordion-overrides a:hover {
    color: var(--primary-red-100, #DF002F);
}