/* ==========================================================================
   LeviShop Pricing Calculator — Frontend Styles
   Reference: Express cups / LimePack-style UI
   ========================================================================== */

:root {
    --lpc-accent: #22c55e;
    --lpc-accent-hover: #16a34a;
    --lpc-accent-light: #dcfce7;
    --lpc-slider-fill: #22c55e;
    --lpc-slider-track: #e5e7eb;
}

.lpc-calculator {
    margin: 24px 0;
    font-family: inherit;
}

/* ---- Attribute groups ---- */
.lpc-attr-group {
    margin-bottom: 24px;
}

.lpc-attr-label {
    display: block;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
    color: #1f2937;
    letter-spacing: 0.02em;
}

/* ---- Horizontal scroll wrapper (LimePack-style) ---- */
.lpc-scroll-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lpc-scroll-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #f3f4f6;
    color: #374151;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: opacity 0.2s, background 0.2s;
    opacity: 0;
}

.lpc-scroll-wrapper:hover .lpc-scroll-btn {
    opacity: 1;
}

.lpc-scroll-wrapper:hover .lpc-scroll-btn:hover {
    background: #e5e7eb;
}

.lpc-scroll-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.lpc-scroll-wrapper.lpc-at-start .lpc-scroll-left,
.lpc-scroll-wrapper.lpc-at-end .lpc-scroll-right {
    opacity: 0.25;
    pointer-events: none;
}

.lpc-radio-cards-wrapper {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.lpc-radio-cards-wrapper::-webkit-scrollbar {
    display: none;
}

/* ---- Radio cards (single row, no wrap) ---- */
.lpc-radio-cards {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 4px 0;
}

.lpc-radio-card {
    position: relative;
    cursor: pointer;
    flex: 0 0 auto;
}

.lpc-radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.lpc-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    box-sizing: border-box;
    padding: 12px 18px;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    transition: all 0.2s ease;
    text-align: center;
}

.lpc-radio-card:hover:not(.lpc-disabled) .lpc-card-body {
    border-color: #9ca3af;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.lpc-radio-card.lpc-selected .lpc-card-body,
.lpc-radio-card input:checked + .lpc-card-body {
    border-color: var(--lpc-accent);
    background: var(--lpc-accent-light);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.lpc-card-title {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    line-height: 1.3;
}

.lpc-card-surcharge {
    margin-top: 4px;
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
}

.lpc-radio-card.lpc-selected .lpc-card-surcharge {
    color: var(--lpc-accent-hover);
}

/* ---- Disabled (unavailable variation) ---- */
.lpc-radio-card.lpc-disabled {
    cursor: not-allowed;
    pointer-events: none;
}

.lpc-radio-card.lpc-disabled .lpc-card-body {
    border-color: #e5e7eb;
    background: #f3f4f6;
    box-shadow: none;
    opacity: 0.45;
}

.lpc-radio-card.lpc-disabled .lpc-card-title {
    color: #9ca3af;
    text-decoration: line-through;
    text-decoration-color: #d1d5db;
}

.lpc-radio-card.lpc-disabled .lpc-card-surcharge {
    color: #d1d5db;
}

/* ---- Quantity group (Auflage) ---- */
.lpc-qty-group {
    margin-bottom: 24px;
}

.lpc-qty-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lpc-qty-input {
    width: 140px;
    padding: 10px 16px;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

.lpc-qty-input:focus {
    border-color: var(--lpc-accent);
}

/* Slider with fill (green on left, grey on right) */
.lpc-slider-wrap {
    position: relative;
    width: 100%;
}

.lpc-qty-range {
    display: block;
    width: 100%;
    height: 10px;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border-radius: 5px;
    outline: none;
}

/* Track */
.lpc-qty-range::-webkit-slider-runnable-track {
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(
        to right,
        var(--lpc-slider-fill) 0%,
        var(--lpc-slider-fill) var(--lpc-slider-percent, 0%),
        var(--lpc-slider-track) var(--lpc-slider-percent, 0%),
        var(--lpc-slider-track) 100%
    );
}

.lpc-qty-range::-moz-range-track {
    height: 10px;
    border-radius: 5px;
    background: var(--lpc-slider-track);
}

.lpc-qty-range::-moz-range-progress {
    height: 10px;
    border-radius: 5px 0 0 5px;
    background: var(--lpc-slider-fill);
}

/* Thumb */
.lpc-qty-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--lpc-accent);
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    margin-top: -7px;
}

.lpc-qty-range::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--lpc-accent);
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Tier hints — 2 равных столбца, плашки одинаковой ширины */
.lpc-tier-hints {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.lpc-tier-hint {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 8px 12px;
    background: #f3f4f6;
    border-radius: 8px;
    font-size: 12px;
    color: #6b7280;
    transition: all 0.2s;
    border: 1px solid transparent;
    box-sizing: border-box;
    text-align: center;
}

.lpc-tier-hint.lpc-tier-active {
    background: var(--lpc-accent-light);
    color: var(--lpc-accent-hover);
    border-color: #86efac;
    font-weight: 600;
}

/* ---- Price display ---- */
.lpc-price-display {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 24px;
}

.lpc-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.lpc-price-row + .lpc-price-row {
    border-top: 1px solid #e5e7eb;
}

.lpc-price-label {
    font-size: 15px;
    color: #4b5563;
    font-weight: 600;
}

.lpc-price-value {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}

.lpc-price-total .lpc-price-label {
    font-size: 17px;
    font-weight: 700;
    color: #1f2937;
}

.lpc-price-total .lpc-price-value {
    font-size: 24px;
    color: var(--lpc-accent-hover);
}

.lpc-price-total-incl {
    border-top: none;
    padding-top: 4px;
}

.lpc-price-total-gross {
    border-top: 1px solid #e5e7eb;
    margin-top: 4px;
    padding-top: 8px;
}

.lpc-price-total-gross .lpc-price-label {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
}

.lpc-price-total-gross .lpc-price-value {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.lpc-price-label--sub {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
}

.lpc-price-value--sub {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

/* ---- Add to cart ---- */
.lpc-add-to-cart {
    margin-top: 4px;
}

.lpc-add-btn {
    display: inline-block;
    width: 100%;
    padding: 16px 28px !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    text-align: center;
    border-radius: 12px !important;
    background: var(--lpc-accent) !important;
    color: #fff !important;
    border: none !important;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    line-height: 1.4 !important;
}

.lpc-add-btn:hover {
    background: var(--lpc-accent-hover) !important;
    transform: translateY(-1px);
}

.lpc-add-btn:active {
    transform: translateY(0);
}

.lpc-add-btn:disabled {
    background: #9ca3b8 !important;
    cursor: not-allowed;
    transform: none;
}

/* Cart message */
.lpc-cart-message {
    margin-top: 12px;
    padding: 0;
    font-size: 14px;
    font-weight: 500;
    min-height: 22px;
    text-align: center;
}

.lpc-msg-success {
    color: var(--lpc-accent-hover);
}

.lpc-msg-error {
    color: #dc2626;
}

/* ---- Responsive: Tablet ---- */
@media (max-width: 768px) {
    .lpc-calculator {
        margin: 16px 0;
    }

    .lpc-attr-group {
        margin-bottom: 18px;
    }

    .lpc-attr-label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .lpc-card-body {
        min-width: 72px;
        padding: 10px 14px;
    }

    .lpc-card-title {
        font-size: 13px;
    }

    .lpc-qty-group {
        margin-bottom: 18px;
    }

    .lpc-price-display {
        padding: 14px 18px;
        margin-bottom: 18px;
    }

    .lpc-price-total .lpc-price-value {
        font-size: 20px;
    }
}

/* ---- Responsive: Mobile — LimePack-style blocks ---- */
@media (max-width: 600px) {
    .lpc-calculator {
        margin: 12px 0;
        padding: 0 2px;
    }

    .lpc-attr-group {
        margin-bottom: 14px;
        padding: 12px 0;
        background: transparent;
        border: none;
        border-radius: 0;
    }

    .lpc-attr-label {
        font-size: 12px;
        font-weight: 600;
        margin-bottom: 8px;
        color: #374151;
        text-transform: none;
        letter-spacing: 0;
    }

    .lpc-scroll-wrapper {
        gap: 4px;
    }

    .lpc-scroll-btn {
        opacity: 1;
        width: 28px;
        height: 28px;
        font-size: 16px;
        background: #fff;
        border: 1px solid #e5e7eb;
        flex-shrink: 0;
    }

    .lpc-scroll-wrapper.lpc-at-start .lpc-scroll-left,
    .lpc-scroll-wrapper.lpc-at-end .lpc-scroll-right {
        opacity: 0.4;
    }

    .lpc-radio-cards {
        gap: 8px;
        padding: 2px 0;
    }

    .lpc-card-body {
        min-width: 64px;
        padding: 8px 12px;
        border-radius: 8px;
        border-width: 2px;
    }

    .lpc-card-title {
        font-size: 12px;
        font-weight: 600;
    }

    .lpc-card-surcharge {
        font-size: 10px;
        margin-top: 2px;
    }

    /* Quantity block */
    .lpc-qty-group {
        margin-bottom: 14px;
        padding: 12px 0;
        background: transparent;
        border: none;
        border-radius: 0;
    }

    .lpc-qty-controls {
        gap: 8px;
    }

    .lpc-qty-input {
        width: 100%;
        max-width: 120px;
        padding: 8px 12px;
        font-size: 16px;
        margin: 0 auto;
        display: block;
    }

    .lpc-slider-wrap {
        margin-top: 4px;
    }

    .lpc-qty-range::-webkit-slider-thumb {
        width: 22px;
        height: 22px;
    }

    .lpc-qty-range::-moz-range-thumb {
        width: 22px;
        height: 22px;
    }

    /* Tier hints — compact grid, smaller text */
    .lpc-tier-hints {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        margin-top: 10px;
    }

    .lpc-tier-hint {
        padding: 6px 10px;
        font-size: 11px;
        border-radius: 6px;
    }

    .lpc-tier-hint.lpc-tier-active {
        font-size: 11px;
    }

    /* Price block — LimePack-style prominent block */
    .lpc-price-display {
        padding: 14px 16px;
        margin-bottom: 14px;
        border-radius: 10px;
        background: #f8fafc;
        border: 1px solid #e5e7eb;
    }

    .lpc-price-row {
        padding: 6px 0;
    }

    .lpc-price-label {
        font-size: 13px;
    }

    .lpc-price-value {
        font-size: 14px;
    }

    .lpc-price-total {
        margin-top: 4px;
        padding-top: 10px;
        border-top: 1px solid #e5e7eb;
    }

    .lpc-price-total .lpc-price-label {
        font-size: 14px;
    }

    .lpc-price-total .lpc-price-value {
        font-size: 20px;
        color: var(--lpc-accent-hover);
    }

    /* Add to cart */
    .lpc-add-btn {
        padding: 14px 20px !important;
        font-size: 15px !important;
        border-radius: 10px !important;
    }
}

/* ==========================================================================
   Single Product Layout Overrides (when calculator is present)
   - Larger product image column, smaller calculator
   - No rounded corners on gallery images
   ========================================================================== */

/* --- Grid: фото побольше, калькулятор поменьше (desktop only) --- */
@media (min-width: 768px) {
    .single-product-content .single-product__grid {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr) !important;
    }
}

/* --- Mobile: stacked layout — images full width, calculator full width below --- */
@media (max-width: 767px) {
    .single-product-content .single-product__grid {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto;
    }

    .single-product-content .single-product__images {
        order: 1;
        position: static;
    }

    .single-product-content .single-product__summary {
        order: 2;
        width: 100%;
        max-width: 100%;
    }
}

.single-product-content .single-product__summary {
    min-width: 0;
}

.single-product-content .single-product__images {
    min-width: 0;
    width: 100%;
}

@media (min-width: 768px) {
    .single-product-content .single-product__images {
        min-width: 420px;
    }
}

/* Gallery & viewport fill the column width.
   IMPORTANT: do NOT override width on __wrapper — FlexSlider needs it
   wider than 100 % to lay slides side-by-side. */
.single-product-content .woocommerce-product-gallery,
.single-product-content .woocommerce-product-gallery .flex-viewport {
    width: 100% !important;
}

/* Отступ между основным изображением и превью */
.single-product-content .woocommerce-product-gallery .flex-control-thumbs {
    margin-top: 12px;
}

/* --- No border-radius --- */
.single-product-content .woocommerce-product-gallery__image img,
.single-product-content .woocommerce-product-gallery__image,
.single-product-content .woocommerce-product-gallery .flex-control-thumbs img {
    border-radius: 0 !important;
}

/* --- Mobile: compact product summary when calculator present --- */
@media (max-width: 600px) {
    .single-product-content .single-product__grid {
        gap: 16px;
        margin-bottom: 20px;
    }

    .single-product-content .single-product__summary {
        padding: 0;
        width: 100%;
        max-width: 100%;
    }

    .single-product-content .product_title {
        font-size: 1.25rem;
        margin-bottom: 10px;
    }

    .single-product-content .woocommerce-product-details__short-description {
        margin-bottom: 12px;
        font-size: 0.875rem;
    }
}
