/**
 * DHT1230 SAV - Frontend Styles
 * Swiss minimalist — noir et blanc
 * Full-width result items: card (left) + note (right)
 *
 * @package DHT1230_SAV
 */

/* ============================================
   Base
   ============================================ */
.dht1230-sav-wrapper *,
.dht1230-sav-wrapper *::before,
.dht1230-sav-wrapper *::after {
    box-sizing: border-box;
}

.dht1230-sav-wrapper {
    width: 100%;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;
    color: #000000;
    background: transparent;
}

.dht1230-sav-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: clamp(1.25rem, 2.5vw, 2rem);
    padding: 0;
}

/* ============================================
   Header / Title
   ============================================ */
.dht1230-sav-header {
    padding-bottom: 1rem;
    border-bottom: 2px solid #000000;
}

.dht1230-sav-title {
    font-size: 18px;
    font-weight: 100;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.3;
}

/* ============================================
   Filters (Selectors)
   ============================================ */
.dht1230-sav-filters-section {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    min-height: 52px;
}

.dht1230-sav-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.dht1230-sav-filter-box {
    position: relative;
    width: 100%;
}

.dht1230-sav-select {
    width: 100%;
    height: 52px;
    padding: 0 2.5rem 0 1rem;
    font-size: 14px;
    font-weight: 400;
    font-family: inherit;
    border: 2px solid #000000;
    border-radius: 0;
    background-color: #ffffff;
    color: #000000;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='2' stroke-linecap='square' stroke-linejoin='miter'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

.dht1230-sav-select:hover {
    background-color: #f5f5f5;
}

.dht1230-sav-select:focus {
    outline: none;
    border-color: #000000;
    box-shadow: none;
}

.dht1230-sav-select:disabled {
    background-color: #f0f0f0;
    color: #999999;
    cursor: not-allowed;
    opacity: 1;
    border-color: #cccccc;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23cccccc' stroke-width='2' stroke-linecap='square' stroke-linejoin='miter'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.dht1230-sav-select option {
    background: #ffffff;
    color: #000000;
}

/* Elementor override */
body .dht1230-sav-select,
body select.dht1230-sav-select {
    font-family: inherit !important;
    font-weight: 400 !important;
    color: #000000 !important;/*
    background-color: #ffffff !important;
    border-style: solid !important;
    border-width: 2px !important;
    border-color: #000000 !important;
    border-radius: 0 !important;
    font-size: 14px !important;
    height: 52px !important;
    padding: 0 2.5rem 0 1rem !important;*/
}

body .dht1230-sav-select:disabled {
    background-color: #f0f0f0 !important;
    border-color: #cccccc !important;
    color: #999999 !important;
}

/* ============================================
   Reset Button
   ============================================ */
.dht1230-sav-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    min-width: 52px;
    padding: 0;
    font-size: 0;
    color: #000000;
    background-color: #ffffff;
    border: 2px solid #000000;
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.dht1230-sav-reset:hover {
    background-color: #000000;
    color: #ffffff;
}

.dht1230-sav-reset svg {
    stroke: currentColor;
    width: 14px;
    height: 14px;
}

.dht1230-sav-reset.inactive {
    opacity: 0.25;
    cursor: not-allowed;
    pointer-events: none;
    display: inline-flex !important;
    background-color: transparent;
}

/* ============================================
   Content Area + Transitions
   ============================================ */
.dht1230-sav-content {
    width: 100%;
    position: relative;
}

/* Fade transition for content states */
.dht1230-sav-initial-message,
.dht1230-sav-results,
.dht1230-sav-no-results {
    animation: dht1230SavFadeIn 0.25s ease-out;
}

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

/* Initial message */
.dht1230-sav-initial-message {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    padding: 2rem;
    text-align: center;
    border: 2px solid #000000;
}

.dht1230-sav-initial-message p {
    font-size: 14px;
    color: #000000;
    margin: 0;
    font-weight: 100;
}

/* No results */
.dht1230-sav-no-results {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    padding: 2rem;
    text-align: center;
    border: 2px solid #000000;
}

.dht1230-sav-no-results p {
    font-size: 14px;
    color: #000000;
    margin: 0;
    font-weight: 100;
}

/* ============================================
   Results Container
   ============================================ */
.dht1230-sav-results {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

/* ============================================
   Result Item: full-width row (card + note)
   ============================================ */
.dht1230-sav-result-item {
    display: grid;
    grid-template-columns: 3fr 2fr;
    width: 100%;
    border: 2px solid #000000;
    transition: background-color 0.15s ease;
}

.dht1230-sav-result-item + .dht1230-sav-result-item {
    border-top: none;
}

.dht1230-sav-result-item:hover {
    background-color: #fafafa;
}

/* Result card — left side */
.dht1230-sav-result-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: transparent;
    border: none;
}

.dht1230-sav-result-card-company {
    font-size: 16px;
    font-weight: 600;
    color: #000000;
    margin: 0;
    line-height: 1.35;
    letter-spacing: -0.01em;
}
h5.dht1230-sav-result-card-company {
    font-size: 1.3em;
}
.dht1230-sav-result-card-address {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #000000;
    font-size: 14px;
    line-height: 1.55;
    font-weight: 400;
}

.dht1230-sav-result-card-address svg {
    flex-shrink: 0;
    margin-top: 2px;
    width: 15px;
    height: 15px;
    fill: currentColor;
    stroke: currentColor;
    stroke-width: 1.5;
}

.dht1230-sav-result-card-address span {
    color: #000000;
}

.dht1230-sav-result-card-contacts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #000000;
    margin-top: 4px;
}

.dht1230-sav-result-card-address path,
.dht1230-sav-result-card-contacts path {
    stroke: transparent;
}

.dht1230-sav-result-card-contact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #000000;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    font-size: 13px;
    transition: opacity 0.15s ease;
    font-weight: 400;
}

.dht1230-sav-result-card-contact:hover {
    opacity: 0.6;
}

.dht1230-sav-result-card-contact svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    fill: currentColor;
    stroke: currentColor;
    stroke-width: 1.5;
}

/* Note panel — right side, borderless */
.dht1230-sav-result-note {
    padding: 20px;
    display: flex;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.7;
    color: #333333;
    font-weight: 400;
    background: transparent;
    border: none;
    border-left: 1px solid #e0e0e0;
}

.dht1230-sav-result-note p {
    margin: 0;
}

.dht1230-sav-result-note:empty,
.dht1230-sav-result-note--empty {
    display: none;
}

/* When note is visible, card has no border-right */
.dht1230-sav-result-item--has-note .dht1230-sav-result-card {
    border-right: none;
}

/* When no note, card takes full width */
.dht1230-sav-result-item--no-note {
    grid-template-columns: 1fr;
}

/* ============================================
   Responsive — Tablet (769–1024px)
   ============================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    .dht1230-sav-result-item {
        grid-template-columns: 1fr 1fr;
    }

    .dht1230-sav-result-card-company {
        font-size: 15px;
    }
}

/* ============================================
   Hide Reset Button (Elementor option)
   ============================================ */
.dht1230-sav-hide-reset .dht1230-sav-reset {
    display: none !important;
}

/* ============================================
   Responsive — Mobile (≤768px)
   ============================================ */
@media (max-width: 768px) {
    .dht1230-sav-container {
        gap: 1rem;
    }

    .dht1230-sav-header {
        padding-bottom: 0.75rem;
    }

    .dht1230-sav-title {
        font-size: 16px;
    }

    /* Stack selectors vertically */
    .dht1230-sav-filters-section {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .dht1230-sav-filters {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        width: 100%;
    }

    .dht1230-sav-select {
        height: 48px;
        font-size: 14px;
    }

    /* Reset: stays as square icon button on the right */
    .dht1230-sav-reset {
        width: 48px;
        height: 48px;
        min-width: 48px;
        position: absolute;
        right: 0;
        top: 0;
    }

    .dht1230-sav-filters-section {
        position: relative;
        padding-right: 56px;
    }

    /* When reset is hidden, remove padding for full-width filters */
    .dht1230-sav-hide-reset .dht1230-sav-filters-section {
        padding-right: 0;
    }

    /* Result: full-width stacked column */
    .dht1230-sav-result-item {
        grid-template-columns: 1fr;
    }

    .dht1230-sav-result-note {
        border-left: none;
        border-top: 1px solid #e0e0e0;
    }

    .dht1230-sav-result-card {
        padding: 16px;
    }

    .dht1230-sav-result-note {
        padding: 16px;
    }

    .dht1230-sav-result-card-company {
        font-size: 15px;
    }

    .dht1230-sav-result-card-address {
        font-size: 13px;
    }

    .dht1230-sav-result-card-contact {
        font-size: 12px;
    }

    .dht1230-sav-initial-message,
    .dht1230-sav-no-results {
        min-height: 100px;
        padding: 1.5rem;
    }

    .dht1230-sav-initial-message p,
    .dht1230-sav-no-results p {
        font-size: 13px;
    }
}

/* ============================================
   Responsive — Extra Small Mobile (<400px)
   ============================================ */
@media (max-width: 399px) {
    .dht1230-sav-container {
        gap: 0.75rem;
    }

    /* Tighter padding for very small screens */
    .dht1230-sav-result-card {
        padding: 12px;
    }

    .dht1230-sav-result-note {
        padding: 12px;
    }

    /* Smaller typography */
    .dht1230-sav-result-card-company {
        font-size: 14px;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .dht1230-sav-result-card-address {
        font-size: 12px;
    }

    .dht1230-sav-result-card-contact {
        font-size: 11px;
        word-break: break-all;
    }

    .dht1230-sav-result-note {
        font-size: 12px;
    }

    /* Smaller icons */
    .dht1230-sav-result-card-address svg {
        width: 13px;
        height: 13px;
    }

    .dht1230-sav-result-card-contact svg {
        width: 12px;
        height: 12px;
    }

    /* Tighter gaps */
    .dht1230-sav-result-card {
        gap: 10px;
    }

    .dht1230-sav-result-card-contacts {
        gap: 6px;
        padding-top: 10px;
        margin-top: 2px;
    }

    /* Smaller selects */
    .dht1230-sav-select {
        height: 44px;
        font-size: 13px;
        padding: 0 2rem 0 0.75rem;
    }

    .dht1230-sav-reset {
        width: 44px;
        height: 44px;
        min-width: 44px;
    }

    .dht1230-sav-filters-section {
        padding-right: 52px;
    }

    .dht1230-sav-hide-reset .dht1230-sav-filters-section {
        padding-right: 0;
    }

    /* Messages */
    .dht1230-sav-initial-message,
    .dht1230-sav-no-results {
        min-height: 80px;
        padding: 1rem;
    }

    .dht1230-sav-initial-message p,
    .dht1230-sav-no-results p {
        font-size: 12px;
    }

    /* Ensure no horizontal overflow */
    .dht1230-sav-wrapper {
        overflow-x: hidden;
    }

    .dht1230-sav-result-item {
        overflow: hidden;
    }
}
