/* =========================================
   Pricing AI for DocDream — LiquidGlass UI
   ========================================= */

.lq-wrapper {
    font-family: var(--lq-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif) !important;
    max-width: 900px;
    margin: 40px auto;
    color: var(--lq-text, #1c1c1e);
    padding-bottom: 90px;
}
/* Перекриваємо шрифти теми для всіх елементів всередині прайсу */
/* body-prefix підвищує специфічність вище ніж більшість правил теми */
body .lq-wrapper,
body .lq-wrapper * {
    font-family: var(--lq-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif) !important;
}
/* Явне перевизначення заголовків — деякі теми цілять h1,h2,h3 окремо */
body .lq-wrapper h1,
body .lq-wrapper h2,
body .lq-wrapper h3,
body .lq-wrapper h4,
body .lq-wrapper h5,
body .lq-wrapper h6 {
    font-family: var(--lq-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif) !important;
}

/* --- Спільний клас для "Чистого скла" --- */
.lq-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(60px) saturate(150%);
    -webkit-backdrop-filter: blur(60px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 28px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
}

/* --- Пошук --- */
.lq-search-bar {
    display: flex;
    align-items: center;
    border-radius: 20px;
    padding: 16px 24px;
    margin-bottom: 40px;
    transition: background 0.3s, box-shadow 0.3s;
}
.lq-search-bar:focus-within {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05), inset 0 0 0 1px rgba(0, 122, 255, 0.3);
}
.lq-search-icon {
    font-size: 22px;
    opacity: 0.4;
    margin-right: 16px;
}
#lq-search {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 18px;
    outline: none;
    color: inherit;
    font-weight: 400;
}
#lq-search::placeholder {
    opacity: 0.3;
}

/* --- Групи (Top Level) --- */
.lq-group {
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(40px) saturate(150%);
    -webkit-backdrop-filter: blur(40px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 28px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    overflow: hidden;
}
.lq-group:hover {
    background: rgba(255, 255, 255, 0.08); /* slight brightness on folder hover */
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.04);
}
.lq-group.lq-open {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.06);
}

.lq-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    cursor: pointer;
    transition: background 0.2s;
}
.lq-group-header:hover {
    background: rgba(255, 255, 255, 0.05); /* Highlight header area inside the folder */
}
.lq-wrapper .lq-group-header h2,
body .lq-wrapper .lq-group-header h2 {
    margin: 0;
    font-family: var(--lq-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif) !important;
    font-size: var(--lq-fs-group, 22px) !important;
    font-weight: var(--lq-fw-group, 500) !important;
    letter-spacing: -0.5px;
    color: var(--lq-group-color, inherit);
}

/* --- Акордеон стрілки --- */
.lq-arrow {
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 0.3;
    font-size: 24px;
}
.lq-group-header:hover .lq-arrow, .lq-sub-header:hover .lq-arrow {
    opacity: 0.6;
}
.lq-open > .lq-group-header .lq-arrow,
.lq-open > .lq-sub-header .lq-arrow {
    transform: rotate(180deg);
    opacity: 0.8;
}

.lq-group-content {
    display: none;
    padding: 0 20px 20px 20px; /* Inside padding for the folder content */
}
.lq-group.lq-open > .lq-group-content {
    display: block;
}

/* --- Підгрупи --- */
.lq-sub {
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.08); /* Вкладений контейнер */
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.015);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    overflow: hidden;
}
.lq-sub:hover {
    background: rgba(255, 255, 255, 0.12);
}
.lq-sub.lq-open {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.03);
    border-color: rgba(255, 255, 255, 0.4);
}

.lq-wrapper .lq-sub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    cursor: pointer;
    font-size: var(--lq-fs-subgroup, 18px) !important;
    font-weight: var(--lq-fw-subgroup, 500) !important;
    transition: background 0.2s;
}
.lq-sub-header:hover {
    background: rgba(255, 255, 255, 0.05); /* Highlight header on hover inside the folder */
}

.lq-sub-content {
    display: none;
    padding: 0 16px 20px 16px;
}
.lq-sub.lq-open > .lq-sub-content {
    display: block;
}

/* --- Послуги (Мінімалістичні плашки) --- */
.lq-item-wrapper {
    margin-bottom: 10px;
}
.lq-item-wrapper:last-child {
    margin-bottom: 0;
}
.lq-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.3); /* Біліший колір на фоні прозорого вкладеного контейнера */
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.01);
    border-radius: 16px;
    padding: 12px 16px;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
.lq-item:hover {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.03);
    transform: translateY(-1px);
}

/* --- Бейджі та Компоненти --- */
.lq-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 8px;
    margin-left: 8px;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.04);
    color: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.05);
    vertical-align: middle;
}

.lq-comp-title {
    font-size: 12px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.4);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lq-item-components {
    padding: 12px 20px 12px 20px;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.7);
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    margin-top: 10px;
    border: 1px solid rgba(255, 255, 255, 0.4);
}
.lq-item-components ul {
    margin: 0;
    padding-left: 0;
    list-style-type: none;
}
.lq-item-components li {
    margin-bottom: 6px;
    display: flex;
    align-items: flex-start;
    line-height: 1.4;
}
.lq-comp-dot {
    width: 4px;
    height: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    margin-top: 8px;
    margin-right: 10px;
    flex-shrink: 0;
}
.lq-qty {
    background: rgba(0, 0, 0, 0.06);
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 11px;
    margin-left: 8px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.6);
}

.lq-wrapper .lq-item-name {
    flex: 1;
    min-width: 0;
    word-break: break-word;
    font-size: var(--lq-fs-item, 15px) !important;
    font-weight: var(--lq-fw-item, 400) !important;
    line-height: 1.4;
    padding-right: 15px;
}

.lq-item-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* --- Плашка ціни --- */
.lq-item-price {
    font-weight: 600;
    font-size: 15px;
    color: var(--lq-price, #007aff);
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 6px 12px;
    border-radius: 12px;
    white-space: nowrap;
}

/* --- Кнопка [+] (Охайне коло) --- */
.lq-btn-add {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    color: var(--lq-btn, #007aff);
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 24px;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}
.lq-btn-add:hover {
    background: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.lq-btn-add:active {
    transform: scale(0.95);
}
.lq-btn-add.in-cart {
    background: #34c759;
    color: #fff;
    border-color: #34c759;
    font-size: 18px;
    font-weight: 500;
}

/* --- Калькулятор (Кошик) --- */
#lq-cart {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 480px; /* розширено для кращої читабельності назв */
    border-radius: 28px;
    z-index: 999999;
    overflow: hidden;
    padding: 0;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}

.lq-cart-tab {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--lq-price, #007aff);
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    transition: background 0.2s;
}
.lq-cart-tab:hover {
    background: rgba(255, 255, 255, 0.6);
}
.lq-cart-arrow {
    transition: transform 0.4s;
    font-size: 10px;
}

.lq-cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: rgba(255, 255, 255, 0.15);
    cursor: pointer;
}
.lq-cart-summary-left {
    font-size: 16px;
    opacity: 0.8;
}
.lq-cart-summary-right {
    font-size: 22px;
    font-weight: 700;
    color: var(--lq-price, #007aff);
}

.lq-cart-body {
    display: flex;
    flex-direction: column;
    max-height: 500px;
    opacity: 1;
    transition: max-height 0.5s ease, opacity 0.4s ease;
}
.lq-cart-header-expanded {
    padding: 12px 24px 16px;
    font-weight: 600;
    font-size: 17px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

#lq-cart-items {
    padding: 16px 24px;
    overflow-y: auto;
    max-height: 350px;
}

.lq-cart-collapsed {
    width: 290px !important;
}
.lq-cart-collapsed .lq-cart-body {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

@media (max-width: 768px) {
    #lq-cart {
        bottom: 20px;
        right: 20px;
        left: 20px;
        width: auto !important; 
    }
}

.lq-ci-name {
    flex: 1;
    overflow: hidden;
    /* Перенос на 2 рядки замість обрізання */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
    text-overflow: unset;
    word-break: break-word;
    line-height: 1.35;
    padding-right: 12px;
}
.lq-ci-price {
    font-weight: 500;
}
.lq-extra-msg {
    text-align: center;
    font-size: 13px;
    opacity: 0.4;
    padding: 12px 0;
    cursor: pointer;
}
/* --- Елементи кошика --- */
.lq-ci {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* вирівнювання по верху при багаторядковій назві */
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    margin-bottom: 8px;
    font-size: 15px;
}
.lq-ci-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.lq-ci-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s;
}
.lq-ci-remove:hover {
    background: #ff3b30;
    color: #fff;
    transform: scale(1.1);
}
.lq-cart-footer {
    padding: 16px 24px;
    display: flex;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}
#lq-cart-clear {
    background: transparent;
    border: none;
    color: #ff3b30;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: opacity 0.2s;
}
#lq-cart-clear:hover {
    opacity: 0.7;
}

/* --- Icons (Info & Time) --- */
.lq-icon-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    vertical-align: middle;
}
.lq-icon-time, .lq-icon-info {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    transition: background 0.2s;
}
.lq-icon-time svg, .lq-icon-info svg {
    opacity: 0.5;
    transition: opacity 0.2s;
}
.lq-icon-info {
    cursor: pointer;
    background: rgba(0,0,0,0.06);
    border-radius: 50%;
    padding: 3px;
}
.lq-icon-time:hover svg {
    opacity: 0.8;
}

/* Custom Tooltip for Time Icon */
.lq-icon-time::after {
    content: attr(data-time);
    position: absolute;
    bottom: 140%; 
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.8);
    color: #1c1c1e;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 500;
    white-space: normal;
    word-wrap: break-word;
    text-align: center;
    width: max-content;
    max-width: 220px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 99999;
    pointer-events: none;
}
.lq-icon-time:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.lq-icon-info:hover {
    background: rgba(0,0,0,0.1);
}
.lq-icon-info:hover svg {
    opacity: 1;
}

@media (max-width: 768px) {
    .lq-item-name {
        position: relative;
    }
    .lq-icon-time {
        position: static;
    }
    .lq-icon-time::after {
        left: 0;
        right: 0;
        margin: 0 auto;
        bottom: calc(100% + 5px);
        transform: translateY(5px);
        width: max-content;
        max-width: 90%;
    }
    .lq-icon-time:hover::after {
        transform: translateY(0);
    }
}

/* --- Info Modal (VisionOS Apple Glass) --- */
#lq-info-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999999;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}
#lq-info-modal.lq-show {
    opacity: 1;
    visibility: visible;
}
.lq-info-modal-content {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.8);
    border-radius: 24px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#lq-info-modal.lq-show .lq-info-modal-content {
    transform: translateY(0) scale(1);
}
.lq-info-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 15px;
}
#lq-info-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1c1c1e;
    line-height: 1.3;
}
#lq-info-close {
    cursor: pointer;
    background: rgba(0,0,0,0.05);
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #555;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
    margin-left: 15px;
}
#lq-info-close:hover {
    background: rgba(0,0,0,0.1);
    color: #000;
}
.lq-info-section {
    margin-bottom: 20px;
}
.lq-info-section h4 {
    margin: 0 0 8px 0;
    font-size: 15px;
    color: var(--lq-price, #007aff);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.lq-info-section p {
    margin: 0;
    font-size: 15px;
    color: #3c3c43;
    line-height: 1.5;
}

/* Loader */
.lq-loader {
    text-align: center;
    padding: 80px;
    opacity: 0.6;
}
.lq-spinner {
    width: 36px; height: 36px;
    border: 3px solid rgba(0,0,0,0.05);
    border-top-color: var(--lq-price, #007aff);
    border-radius: 50%;
    animation: lqSpin 1s infinite linear;
    margin: 0 auto 16px;
}
@keyframes lqSpin { to { transform: rotate(360deg); } }

/* Mobile */
@media (max-width: 600px) {
    #lq-search {
        font-size: 15px;
        min-width: 0;
        text-overflow: ellipsis;
    }
    
    .lq-group-header h2 {
        font-size: calc(var(--lq-fs-group, 22px) * 0.85) !important;
    }
    
    .lq-sub-header {
        font-size: calc(var(--lq-fs-subgroup, 18px) * 0.85) !important;
    }
    
    .lq-item-name {
        font-size: calc(var(--lq-fs-item, 15px) * 0.9) !important;
    }

    .lq-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .lq-item-right {
        width: 100%;
        justify-content: space-between;
    }

    #lq-cart {
        width: calc(100% - 40px);
        left: 20px;
        right: 20px;
        bottom: 20px;
    }
}
