/* ============================================================
   PRIME STATE - CUSTOM VIAL & PACK SELECTOR
============================================================ */

.ps-custom-product-selector {
    width: 100%;
    display: block;
    box-sizing: border-box;
    margin-bottom: 20px;
}

.variations_form.ps-has-custom-selector table.variations {
    display: none !important;
}

.variations_form.ps-has-custom-selector .woocommerce-variation-price {
    display: none !important;
}

/* ============================================================
   SECTION TITLES
============================================================ */

.ps-section-title {
    margin: 0 0 10px;
    color: #102653 !important;
    font-size: 20px;
    line-height: 1.25;
    font-weight: 700;
}

/* ============================================================
   VIAL SIZE OPTIONS
============================================================ */

.ps-vial-section {
    width: 100%;
    margin: 0 0 18px;
}

.ps-vial-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ps-vial-option,
.ps-vial-option:hover,
.ps-vial-option:focus,
.ps-vial-option:active,
.ps-vial-option:visited {
    min-width: 80px;
    padding: 9px 18px !important;
    box-sizing: border-box;
    border: 1px solid #d3dce7 !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    color: #102653 !important;
    font-size: 15px !important;
    line-height: 1.2 !important;
    font-weight: 600 !important;
    text-align: center;
    cursor: pointer;
    box-shadow: none !important;
    text-decoration: none !important;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.ps-vial-option:hover {
    border-color: #1595ee !important;
    background: #f4fbff !important;
    color: #102653 !important;
}

.ps-vial-option.selected,
.ps-vial-option.selected:hover,
.ps-vial-option.selected:focus,
.ps-vial-option.selected:active {
    border: 2px solid #1595ee !important;
    background: #f4fbff !important;
    color: #102653 !important;
    box-shadow: none !important;
}

/* ============================================================
   PACK SIZE OPTIONS (DESKTOP)
============================================================ */

.ps-pack-section {
    width: 100%;
    margin: 0 0 16px;
}

.ps-pack-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

.ps-pack-option,
.ps-pack-option:hover,
.ps-pack-option:focus,
.ps-pack-option:active {
    min-height: 105px;
    padding: 13px 10px 12px;
    box-sizing: border-box;
    border: 1px solid #d3dce7 !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    color: #102653 !important;
    text-align: center;
    cursor: pointer;
    box-shadow: none !important;
    transition: border-color 0.2s ease, background 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ps-pack-option:hover {
    border-color: #1595ee !important;
    background: #f4fbff !important;
    color: #102653 !important;
}

.ps-pack-option.selected,
.ps-pack-option.selected:hover,
.ps-pack-option.selected:focus,
.ps-pack-option.selected:active {
    border: 2px solid #1595ee !important;
    background: #f4fbff !important;
    color: #102653 !important;
    box-shadow: none !important;
}

.ps-pack-name {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    margin-bottom: 5px;
}

.ps-pack-num {
    font-size: 20px;
    line-height: 1.2;
    font-weight: 700;
    color: #102653;
}

.ps-pack-unit {
    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;
    color: #102653;
}

.ps-pack-price {
    display: block;
    margin-bottom: 8px;
    color: #18243b !important;
    font-size: 16px;
    line-height: 1.25;
    font-weight: 400;
}

.ps-pack-saving {
    display: inline-block;
    padding: 5px 13px;
    border-radius: 20px;
    background: #e1f2ff !important;
    color: #0878c9 !important;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 700;
}

.ps-pack-saving:empty {
    display: none !important;
}

.ps-pack-option.ps-pack-unavailable {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================================
   CARD CONTAINER (DESKTOP)
============================================================ */

.ps-card-container {
    width: 100%;
    margin: 0 0 16px;
    display: block;
}

.ps-mobile-badge {
    display: none;
}

.ps-ref-tag {
    display: none;
}

.ps-mobile-total-line {
    display: none;
}

.ps-mobile-qty-label {
    display: none;
}

.ps-desktop-qty-label {
    display: inline;
}

/* Sticky bar hidden on desktop */
.ps-mobile-sticky-bar {
    display: none !important;
}

/* ============================================================
   PRICE SUMMARY INNER (DESKTOP)
============================================================ */

.ps-price-summary-inner {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) minmax(160px, 1.45fr) minmax(150px, 1.25fr);
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 16px;
    box-sizing: border-box;
    border-radius: 10px;
    background: #f3f7fa;
    margin-bottom: 16px;
}

/* Original Single-vial reference */
.ps-original-price {
    min-width: 0;
    padding-right: 15px;
    border-right: 1px solid #c9d0d8;
}

.ps-original-price-value {
    display: block;
    color: #7c8490 !important;
    font-size: 15px;
    line-height: 1.3;
    text-decoration: line-through;
}

.ps-original-price-label {
    display: block;
    margin-top: 3px;
    color: #9299a3 !important;
    font-size: 12px;
    line-height: 1.35;
}

/* Current price */
.ps-current-price {
    min-width: 0;
}

.ps-current-price-value {
    display: block;
    color: #102653 !important;
    font-size: 28px;
    line-height: 1.05;
    font-weight: 800;
}

.ps-current-price-label {
    display: block;
    margin-top: 5px;
    color: #667085 !important;
    font-size: 13px;
    line-height: 1.3;
}

/* Saving */
.ps-saving {
    min-width: 0;
    padding: 11px 12px;
    box-sizing: border-box;
    border-radius: 9px;
    background: #dcefff !important;
    text-align: center;
}

.ps-saving-value {
    display: block;
    color: #0875c4 !important;
    font-size: 18px;
    line-height: 1.25;
    font-weight: 800;
}

/* ============================================================
   QUANTITY (DESKTOP)
============================================================ */

.ps-quantity-section {
    width: 100%;
    margin: 0 0 16px;
}

.ps-quantity-title {
    margin-bottom: 7px;
    color: #102653 !important;
    font-size: 15px;
    line-height: 1.2;
    font-weight: 700;
}

.ps-quantity-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ps-quantity-control {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 160px;
    height: 48px;
    box-sizing: border-box;
    overflow: hidden;
    border: 1px solid #d8dee7;
    border-radius: 24px;
    background: #ffffff;
}

.ps-quantity-minus,
.ps-quantity-plus,
.ps-quantity-minus:hover,
.ps-quantity-plus:hover,
.ps-quantity-minus:focus,
.ps-quantity-plus:focus,
.ps-quantity-minus:active,
.ps-quantity-plus:active {
    flex: 0 0 50px !important;
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    height: 46px !important;
    min-height: 46px !important;
    max-height: 46px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    outline: none !important;
    background: #ffffff !important;
    color: #102653 !important;
    font-size: 22px !important;
    line-height: 1 !important;
    font-weight: 600 !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
    transform: none !important;
    transition: background-color 0.15s ease !important;
    user-select: none !important;
    box-sizing: border-box !important;
}

.ps-quantity-minus:hover,
.ps-quantity-plus:hover {
    background: #f3f7fa !important;
    color: #102653 !important;
    transform: none !important;
}

.ps-quantity-input {
    flex: 1 1 auto !important;
    width: 60px !important;
    height: 46px !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-left: 1px solid #e2e6eb !important;
    border-right: 1px solid #e2e6eb !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    color: #102653 !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    text-align: center !important;
    outline: none !important;
    box-shadow: none !important;
    -moz-appearance: textfield;
}

.ps-quantity-input::-webkit-outer-spin-button,
.ps-quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ps-quantity-description {
    color: #667085 !important;
    font-size: 14px;
    line-height: 1.3;
    white-space: nowrap;
}

/* ============================================================
   HIDE ORIGINAL WOOCOMMERCE ROWS
============================================================ */

.variations_form .ps-original-vial-row-hidden,
.variations_form .ps-original-pack-row-hidden {
    display: none !important;
}

.variations_form .reset_variations {
    display: none !important;
}

.woocommerce-variation-add-to-cart .quantity {
    display: none !important;
}

/* ============================================================
   ADD TO CART BUTTON (DESKTOP)
============================================================ */

.woocommerce-variation-add-to-cart .single_add_to_cart_button,
.woocommerce-variation-add-to-cart .single_add_to_cart_button:hover,
.woocommerce-variation-add-to-cart .single_add_to_cart_button:focus,
.woocommerce-variation-add-to-cart .single_add_to_cart_button:active {
    width: 100% !important;
    min-height: 52px !important;
    margin: 0 !important;
    padding: 12px 24px !important;
    box-sizing: border-box;
    border: 0 !important;
    border-radius: 6px !important;
    background: #008ff5 !important;
    color: #ffffff !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    cursor: pointer;
    box-shadow: none !important;
    text-decoration: none !important;
}

.woocommerce-variation-add-to-cart .single_add_to_cart_button:hover {
    background: #007ddd !important;
    color: #ffffff !important;
}

.woocommerce-variation-add-to-cart .single_add_to_cart_button.disabled,
.woocommerce-variation-add-to-cart .single_add_to_cart_button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================
   MOBILE DEVICE RESPONSIVE DESIGN (MATCHES USER SCREENSHOT)
============================================================ */

@media (max-width: 767px) {
    .ps-custom-product-selector {
        margin-bottom: 14px;
    }

    .ps-section-title {
        font-size: 17px !important;
        margin-bottom: 8px !important;
    }

    .ps-vial-section {
        margin-bottom: 12px !important;
    }

    .ps-vial-options {
        gap: 6px !important;
    }

    .ps-vial-option {
        min-width: 65px !important;
        padding: 7px 14px !important;
        font-size: 14px !important;
    }

    /* 1. COMPACT 3-TAB PACK ROW */
    .ps-pack-section {
        margin-bottom: 12px !important;
    }

    .ps-pack-options {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }

    .ps-pack-option,
    .ps-pack-option:hover,
    .ps-pack-option:focus,
    .ps-pack-option:active {
        min-height: unset !important;
        height: 58px !important;
        padding: 6px 4px !important;
        border-radius: 10px !important;
        border: 1px solid #d3dce7 !important;
        background: #ffffff !important;
    }

    .ps-pack-option.selected {
        border: 2px solid #008ff5 !important;
        background: #f0f7fe !important;
    }

    .ps-pack-name {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
        gap: 0 !important;
    }

    .ps-pack-num {
        font-size: 19px !important;
        font-weight: 700 !important;
        line-height: 1.1 !important;
        color: #102653 !important;
    }

    .ps-pack-unit {
        font-size: 12px !important;
        font-weight: 400 !important;
        color: #64748b !important;
        line-height: 1 !important;
        margin-top: 2px !important;
    }

    .ps-pack-option.selected .ps-pack-num {
        color: #008ff5 !important;
    }

    .ps-pack-option.selected .ps-pack-unit {
        color: #008ff5 !important;
        font-weight: 600 !important;
    }

    /* Hide long price and saving pills from inside top buttons on mobile */
    .ps-pack-price,
    .ps-pack-saving {
        display: none !important;
    }

    /* 2. COMPACT SUMMARY CARD (WHITE CARD WITH BORDER) */
    .ps-card-container {
        display: block !important;
        background: #ffffff !important;
        border: 1px solid #e1e7ef !important;
        border-radius: 14px !important;
        padding: 16px 14px 14px !important;
        margin: 0 0 14px !important;
        box-shadow: 0 1px 4px rgba(16, 38, 83, 0.04) !important;
    }

    /* Top badge: 20-pack • SAVE 30% */
    .ps-mobile-badge {
        display: block !important;
        color: #008ff5 !important;
        font-size: 14px !important;
        font-weight: 700 !important;
        line-height: 1.3 !important;
        margin-bottom: 4px !important;
    }

    .ps-price-summary-inner {
        display: flex !important;
        flex-direction: column !important;
        gap: 3px !important;
        padding: 0 !important;
        background: transparent !important;
        margin-bottom: 0 !important;
    }

    /* Reference line: $599.00 / vial (reference) */
    .ps-original-price {
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        display: flex !important;
        align-items: baseline !important;
        gap: 5px !important;
    }

    .ps-original-price-value {
        color: #8c95a3 !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        text-decoration: line-through !important;
        line-height: 1.3 !important;
    }

    .ps-original-price-label {
        display: none !important;
    }

    .ps-ref-tag {
        display: inline !important;
        color: #8c95a3 !important;
        font-size: 14px !important;
        font-weight: 400 !important;
        line-height: 1.3 !important;
    }

    /* Current price: $419.30 / vial */
    .ps-current-price {
        margin: 2px 0 0 !important;
    }

    .ps-current-price-value {
        font-size: 28px !important;
        font-weight: 800 !important;
        color: #102653 !important;
        line-height: 1.1 !important;
        display: block !important;
    }

    .ps-current-price-label {
        display: none !important;
    }

    /* Pack total $8,386.00 USD */
    .ps-mobile-total-line {
        display: block !important;
        margin-top: 5px !important;
        font-size: 14px !important;
        color: #334155 !important;
        line-height: 1.3 !important;
    }

    .ps-mobile-total-val {
        font-weight: 700 !important;
        color: #102653 !important;
    }

    /* Instant save: Save $3,594.00 instantly */
    .ps-saving {
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 4px 0 0 !important;
        text-align: left !important;
    }

    .ps-saving-value {
        color: #16a34a !important;
        font-size: 15px !important;
        font-weight: 700 !important;
        text-align: left !important;
        display: block !important;
        line-height: 1.3 !important;
    }

    /* 3. QUANTITY ROW INSIDE CARD */
    .ps-quantity-section {
        margin: 14px 0 0 !important;
        padding-top: 14px !important;
        border-top: 1px solid #f1f4f8 !important;
        width: 100% !important;
    }

    .ps-quantity-row {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        gap: 10px !important;
    }

    .ps-desktop-qty-label {
        display: none !important;
    }

    .ps-mobile-qty-label {
        display: inline !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        color: #102653 !important;
    }

    .ps-quantity-title {
        margin: 0 !important;
    }

    .ps-quantity-description {
        display: none !important;
    }

    .ps-quantity-control {
        width: 126px !important;
        height: 42px !important;
        border-radius: 21px !important;
    }

    .ps-quantity-minus,
    .ps-quantity-plus,
    .ps-quantity-minus:hover,
    .ps-quantity-plus:hover,
    .ps-quantity-minus:focus,
    .ps-quantity-plus:focus,
    .ps-quantity-minus:active,
    .ps-quantity-plus:active {
        flex: 0 0 38px !important;
        width: 38px !important;
        min-width: 38px !important;
        max-width: 38px !important;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        font-size: 20px !important;
    }

    .ps-quantity-input {
        width: 50px !important;
        height: 40px !important;
        font-size: 16px !important;
    }

    /* 4. PILL SHAPED ADD TO CART BUTTON */
    .woocommerce-variation-add-to-cart .single_add_to_cart_button,
    .woocommerce-variation-add-to-cart .single_add_to_cart_button:hover,
    .woocommerce-variation-add-to-cart .single_add_to_cart_button:focus,
    .woocommerce-variation-add-to-cart .single_add_to_cart_button:active {
        height: 52px !important;
        border-radius: 30px !important;
        font-size: 16px !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.3px !important;
    }

    /* 5. STICKY BOTTOM BAR (MATCHES USER SCREENSHOT) */
    .ps-mobile-sticky-bar {
        display: flex !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        background: #ffffff !important;
        box-shadow: 0 -4px 16px rgba(16, 38, 83, 0.09) !important;
        border-top: 1px solid #e2e8f0 !important;
        padding: 10px 16px !important;
        padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
        z-index: 999999 !important;
        justify-content: space-between !important;
        align-items: center !important;
        box-sizing: border-box !important;
    }

    .ps-sticky-info {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        color: #008ff5 !important;
        font-size: 15px !important;
        font-weight: 700 !important;
        line-height: 1.2 !important;
    }

    .ps-sticky-pack-text,
    .ps-sticky-dot,
    .ps-sticky-price-text {
        color: #008ff5 !important;
        font-weight: 700 !important;
        font-size: 15px !important;
    }

    .ps-sticky-btn {
        background: #008ff5 !important;
        color: #ffffff !important;
        border: none !important;
        border-radius: 26px !important;
        padding: 11px 22px !important;
        font-size: 14px !important;
        font-weight: 700 !important;
        letter-spacing: 0.3px !important;
        cursor: pointer !important;
        outline: none !important;
        box-shadow: none !important;
        transition: background 0.15s ease !important;
        white-space: nowrap !important;
        line-height: 1 !important;
        text-transform: uppercase !important;
    }

    .ps-sticky-btn:hover,
    .ps-sticky-btn:active {
        background: #007ddd !important;
        color: #ffffff !important;
    }

    .ps-sticky-btn.disabled,
    .ps-sticky-btn:disabled {
        opacity: 0.5 !important;
        cursor: not-allowed !important;
    }

    /* Extra bottom clearance so nothing gets hidden behind sticky bar */
    .ps-custom-product-selector {
        margin-bottom: 75px !important;
    }
}
