/* ============================================================
   tx_phone â€“ Front CSS
   KompatibilnÃ­ s PS 1.7+ / Bootstrap 3 + 4
   ============================================================ */

/* --- TRIGGER BUTTON ---------------------------------------- */
.tx-phone-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0px 16px;
    background: #fff;
    color: #a6884f;
    border: 1px solid #a6884f;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;    
    letter-spacing: .02em;
}
.tx-phone-trigger:hover,
.tx-phone-trigger:focus {        
    outline: none;
}
.tx-phone-trigger:active {
    
}
.tx-phone-trigger__icon {
    display: flex;
    align-items: center;
}

/* --- OVERLAY ----------------------------------------------- */
.tx-phone-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.52);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: txFadeIn .18s ease;
}
.tx-phone-overlay[hidden] {
    display: none !important;
}

@keyframes txFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* --- MODAL ------------------------------------------------- */
.tx-phone-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.22);
    width: 100%;
    max-width: 420px;
    position: relative;
    animation: txSlideUp .22s cubic-bezier(.34,1.56,.64,1);
    overflow: visible; /* musÃ­ bÃ½t visible, jinak oÅ™Ã­zne dropdown pÅ™edvolby */
}

@keyframes txSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Close button */
.tx-phone-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .15s, background .15s;
    z-index: 1;
}
.tx-phone-modal__close:hover {
    color: #333;
    background: #f0f0f0;
}

/* --- PANELS ------------------------------------------------ */
.tx-phone-panel {
    padding: 28px 28px 24px;
    background: #fff;
    border-radius: 12px;
}
.tx-phone-panel--success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 28px;
    background: #fff;
    border-radius: 12px;
}
.tx-phone-panel[hidden],
.tx-phone-panel--success[hidden] {
    display: none !important;
}

/* Header */
.tx-phone-modal__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}
.tx-phone-modal__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(166, 136, 79, 0.1);
    border-radius: 50%;
    color: #a6884f;
    flex-shrink: 0;
}
.tx-phone-modal__title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.2;
}

/* Body */
.tx-phone-modal__body {
    margin-bottom: 20px;
}

/* Footer */
.tx-phone-modal__footer {}

/* --- PHONE FIELD ------------------------------------------- */
.tx-phone-field__label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
    letter-spacing: 0;
    text-transform: none;
    text-align: left;
}
.tx-phone-field__row {
    display: flex;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    overflow: visible;
    transition: border-color .2s;
    background: #fff;
}
.tx-phone-field__row:focus-within {
    border-color: #a6884f;
}
.tx-phone-field__input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0px 12px;
    font-size: 16px;
    color: #1a1a1a;
    background: transparent;
    min-width: 0;
    letter-spacing: .04em;
}
.tx-phone-field__input::placeholder {
    color: #bbb;
}

/* Error */
.tx-phone-field__error {
    display: block;
    color: #e53935;
    font-size: 13px;
    margin-top: 6px;
}
.tx-phone-field__error[hidden] {
    display: none !important;
}
.tx-phone-field__row--error {
    border-color: #e53935 !important;
}

/* --- DIAL DROPDOWN ----------------------------------------- */
.tx-phone-dial {
    position: relative;
    flex-shrink: 0;
}
.tx-phone-dial__btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 10px 12px 14px;
    background: #f9f9f9;
    border: none;
    border-right: 2px solid #e0e0e0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    transition: background .15s;
    border-radius: 6px 0 0 6px;
}
.tx-phone-dial__btn:hover {
    background: #f0f0f0;
}
.tx-phone-dial__flag {
    font-size: 18px;
    line-height: 1;
    position: relative;
    top: -2px;
}
.tx-phone-dial__code {
    font-size: 14px;
    color: #444;
}
.tx-phone-dial__arrow {
    color: #888;
    transition: transform .2s;
}
.tx-phone-dial__btn[aria-expanded="true"] .tx-phone-dial__arrow {
    transform: rotate(180deg);
}

/* Dropdown list */
.tx-phone-dial__list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    min-width: 220px;
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    z-index: 100000;
    list-style: none;
    margin: 0;
    padding: 4px 0;
}
.tx-phone-dial__list[hidden] {
    display: none !important;
}
.tx-phone-dial__item {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 9px 14px;
    cursor: pointer;
    transition: background .12s;
    font-size: 14px;
}
.tx-phone-dial__item:hover,
.tx-phone-dial__item[aria-selected="true"] {
    background: #f0fae6;
}
.tx-phone-dial__item[aria-selected="true"] {
    font-weight: 600;
}
.tx-phone-dial__item-flag {
    font-size: 16px;
    width: 28px !important;
    min-width: 28px !important;
    display: inline-block !important;
    text-align: center !important;
    line-height: 1;
}
.tx-phone-dial__item-name {
    flex: 1;
    color: #333;
    padding-left: 6px;
}
.tx-phone-dial__item-dial {
    color: #888;
    font-size: 13px;
    width: 48px !important;
    min-width: 48px !important;
    text-align: right !important;
    display: inline-block !important;
}

/* --- GDPR -------------------------------------------------- */
.tx-phone-gdpr {
    font-size: 11px;
    color: #888;
    margin: 5px 0 0 !important;
    line-height: 1.5;
}
.tx-phone-gdpr a {
    color: #888;
    text-decoration: underline;
}
.tx-phone-gdpr a:hover {
    color: #a6884f;
}

/* --- SUBMIT BUTTON ----------------------------------------- */
.tx-phone-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background: #a6884f;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;    
    letter-spacing: .03em;
}
.tx-phone-submit:hover {
    
}
.tx-phone-submit:disabled {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.tx-phone-submit__spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: txSpin .7s linear infinite;
}
.tx-phone-submit__spinner[hidden] {
    display: none !important;
}

@keyframes txSpin {
    to { transform: rotate(360deg); }
}

/* --- SUCCESS PANEL ----------------------------------------- */
.tx-phone-success__icon {
    color: #43a047;
    margin-bottom: 16px;
}
.tx-phone-success__text {
    font-size: 16px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 24px;
}
.tx-phone-close-btn {
    display: inline-flex;
    align-items: center;
    padding: 11px 28px;
    border: none;
    border-radius: 6px;
    background: #a6884f;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

/* --- RESPONSIVE -------------------------------------------- */
@media (max-width: 480px) {
    .tx-phone-modal {
        border-radius: 12px 12px 0 0;
        max-width: 100%;
    }
    .tx-phone-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .tx-phone-panel {
        padding: 24px 20px 20px;
    }
}
