/* ============================================
   assets/css/catalog-modal.css
   "Get Your Catalog" popup — La Casa Modular
   ============================================ */

.lcm-catalog-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 14, 6, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 3vw, 40px);
    z-index: 100000;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.lcm-catalog-modal-overlay.is-open {
    display: flex;
    opacity: 1;
}

.lcm-catalog-modal {
    position: relative;
    width: clamp(320px, 90vw, 718px);
    max-height: 90vh;
    overflow-y: auto;
    background: #FBF5EE;
    border-radius: 10px;
    padding: clamp(28px, 2.92vw, 56px);
    box-shadow: 0 30px 80px rgba(20, 14, 6, 0.45);
    transform: translateY(12px) scale(0.98);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.lcm-catalog-modal-overlay.is-open .lcm-catalog-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.lcm-catalog-modal::-webkit-scrollbar { width: 8px; }
.lcm-catalog-modal::-webkit-scrollbar-thumb {
    background: rgba(184, 169, 106, 0.4);
    border-radius: 8px;
}

.lcm-catalog-modal__close {
    position: absolute;
    top: clamp(14px, 1.8vw, 28px);
    right: clamp(14px, 1.8vw, 28px);
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(45, 34, 16, 0.06);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2D2210;
    cursor: pointer;
    transition: background 0.2s ease;
}
.lcm-catalog-modal__close:hover { background: rgba(45, 34, 16, 0.14); }
.lcm-catalog-modal__close svg { width: 16px; height: 16px; display: block; }

.lcm-catalog-modal__header {
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 1.25vw, 24px);
    max-width: 606px;
    margin: 0 auto clamp(26px, 2.5vw, 48px);
    text-align: center;
}

.lcm-catalog-modal__title {
    font-family: var(--lcm-font-kinfolk, 'Kinfolk'), serif;
    font-weight: 400;
    font-style: normal;
    font-size: clamp(24px, 2.08vw, 40px);
    line-height: 1.05;
    letter-spacing: 0;
    color: #2D2210;
    margin: 0;
}

.lcm-catalog-modal__subtitle {
    font-family: var(--lcm-font-garamond, 'adobe-garamond-pro'), serif;
    font-weight: 400;
    font-style: normal;
    font-size: clamp(15px, 1.25vw, 24px);
    line-height: 1;
    letter-spacing: 0.03em;
    color: #B78758;
    margin: 0;
}

.lcmpop__form {
    display: flex;
    flex-direction: column;
    gap: clamp(24px, 3.75vw, 72px);
    background: #2D2210;
    border-radius: 10px;
    padding: 30px;
    max-width: 606px;
    margin: 0 auto;
}

.lcmpop__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(14px, 1.4vw, 20px);
}

.lcmpop__group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lcmpop__label {
    font-family: var(--lcm-font-garamond, 'adobe-garamond-pro'), serif;
    font-weight: 700;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: 0.03em;
    vertical-align: bottom;
    color: #FBF5EE;
}

.lcmpop__req { color: #B78758; }

.lcmpop__input {
    background: transparent;
    border: none;
    border-bottom: 1.5px solid rgba(251, 245, 238, 0.35);
    border-radius: 0;
    padding: 10px 0;
    font-family: var(--lcm-font-garamond, 'adobe-garamond-pro'), serif;
    font-weight: 400;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: 0.03em;
    vertical-align: bottom;
    color: #FBF5EE;
    outline: none;
    width: 100%;
    transition: border-color 0.25s ease;
    -webkit-appearance: none;
    appearance: none;
}
.lcmpop__input::placeholder { color: rgba(251, 245, 238, 0.45); }
.lcmpop__input:focus { border-bottom-color: #B78758; }

.lcmpop__select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23FBF5EE' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    padding-right: 24px;
    background-color: transparent;
}
.lcmpop__select option { color: #2D2210; }

.lcmpop__phone-wrap {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    border-bottom: 1.5px solid rgba(251, 245, 238, 0.35);
    transition: border-color 0.25s ease;
}
.lcmpop__phone-wrap:focus-within { border-bottom-color: #B78758; }
.lcmpop__input--phone { border-bottom: none; flex: 1; }

.lcmpop__flag-dropdown { position: relative; flex-shrink: 0; }

.lcmpop__flag-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    padding: 10px 4px 10px 0;
    font-family: var(--lcm-font-garamond, 'adobe-garamond-pro'), serif;
    font-weight: 400;
    font-size: 20px;
    letter-spacing: 0.03em;
    color: #FBF5EE;
    cursor: pointer;
}
.lcmpop__flag-icon {
    width: 22px; height: 16px;
    object-fit: cover; border-radius: 2px;
    display: block; flex-shrink: 0;
}
.lcmpop__flag-trigger::after {
    content: '';
    width: 7px; height: 7px;
    border-right: 1.5px solid #FBF5EE;
    border-bottom: 1.5px solid #FBF5EE;
    transform: rotate(45deg);
    margin-left: 2px;
    transition: transform 0.2s ease;
}
.lcmpop__flag-dropdown.open .lcmpop__flag-trigger::after { transform: rotate(225deg); }

.lcmpop__flag-list {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 220px;
    max-height: 260px;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 0;
    background: #fff;
    border: 1px solid #b8926a;
    border-radius: 4px;
    box-shadow: 0 12px 30px rgba(30, 17, 8, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 10;
}
.lcmpop__flag-dropdown.open .lcmpop__flag-list {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.lcmpop__flag-list li {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px;
    font-family: var(--lcm-font-garamond, 'adobe-garamond-pro'), serif;
    font-size: 14px;
    color: #4a3620;
    cursor: pointer;
    transition: background 0.15s ease;
}
.lcmpop__flag-list li:hover,
.lcmpop__flag-list li.selected { background: #f1e5d4; }
.lcmpop__flag-list li img {
    width: 20px; height: 14px;
    object-fit: cover; border-radius: 2px; flex-shrink: 0;
}

.lcmpop__feedback {
    font-family: var(--lcm-font-garamond, 'adobe-garamond-pro'), serif;
    font-size: 14px;
    min-height: 20px;
    color: #FBF5EE;
}
.lcmpop__feedback--success { color: #9fd18a; }
.lcmpop__feedback--error { color: #e29a86; }

.lcmpop__submit {
    width: 100%;
    height: 56px;
    padding: 16px 32px;
    gap: 10px;
    background: #B78758;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--lcm-font-garamond, 'adobe-garamond-pro'), serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 1;
    letter-spacing: 0.03em;
    text-align: center;
    text-transform: none;
    color: #FBF5EE;
    transition: background 0.25s ease, opacity 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lcmpop__submit:hover:not(:disabled) { background: #2D2210; }
.lcmpop__submit:disabled { opacity: 0.6; cursor: not-allowed; }

.lcmpop__submit-loader {
    display: none;
    width: 16px; height: 16px;
    border: 2px solid rgba(251, 245, 238, 0.4);
    border-top-color: #FBF5EE;
    border-radius: 50%;
    animation: lcmpopSpin 0.75s linear infinite;
    flex-shrink: 0;
}
.lcmpop__submit--loading .lcmpop__submit-loader { display: block; }
.lcmpop__submit--loading .lcmpop__submit-label { opacity: 0.7; }
@keyframes lcmpopSpin { to { transform: rotate(360deg); } }

.lcmpop__form[hidden] { display: none; }
.lcmpop__success[hidden] { display: none; }

.lcmpop__success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px 0 4px;
    animation: lcmpopFadeIn 0.4s ease;
}
.lcmpop__success-icon {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: #B78758;
    color: #FBF5EE;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 18px;
}
.lcmpop__success-title {
    font-family: var(--lcm-font-kinfolk, 'Kinfolk'), serif;
    font-size: clamp(22px, 1.9vw, 32px);
    font-weight: 400;
    color: #2D2210;
    margin: 0 0 12px;
}
.lcmpop__success-text {
    font-family: var(--lcm-font-garamond, 'adobe-garamond-pro'), serif;
    font-size: 15px;
    line-height: 1.6;
    color: #6b5a42;
    max-width: 420px;
    margin: 0 0 8px;
}
@keyframes lcmpopFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .lcm-catalog-modal {
        padding: 24px 20px;
        border-radius: 8px;
    }

    .lcm-catalog-modal__header {
        gap: 8px;
        margin-bottom: 20px;
    }

    .lcmpop__form {
        gap: 18px;
        padding: 20px;
        border-radius: 8px;
    }

    .lcmpop__row {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .lcmpop__group {
        gap: 6px;
    }

    .lcmpop__label {
        font-size: 13px;
    }

    .lcmpop__input,
    .lcmpop__flag-trigger {
        font-size: 16px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .lcmpop__submit {
        height: 48px;
        font-size: 15px;
    }
}

@media (max-width: 380px) {
    .lcmpop__row { grid-template-columns: 1fr; gap: 12px; }
}

body.lcm-modal-open { overflow: hidden; }