/* ==========================================================================
   Products Multiple Pricing — Frontend Styles
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Pricing Section Wrapper ── */
.pmp-pricing-section {
    margin: 20px 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Current Price Display ── */
.pmp-current-price-display {
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 16px;
    color: #fff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

.pmp-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pmp-price-total-row {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,.25);
}

.pmp-price-label {
    font-size: 13px;
    font-weight: 500;
    opacity: .85;
}

.pmp-price-value {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.pmp-price-total {
    font-size: 15px;
    font-weight: 600;
}

/* ── Pricing Table Container ── */
.pmp-table-container {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.pmp-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #f9fafb;
    border-bottom: 1.5px solid #e5e7eb;
}

.pmp-table-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.pmp-table-title svg {
    width: 16px;
    height: 16px;
    color: #6366f1;
}

.pmp-variation-name {
    font-size: 12px;
    font-weight: 600;
    color: #6366f1;
    background: #eef2ff;
    padding: 3px 10px;
    border-radius: 99px;
}

/* ── Price Table ── */
.pmp-price-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.pmp-price-table thead tr {
    background: #f3f4f6;
}

.pmp-price-table thead th {
    padding: 10px 18px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
}

.pmp-price-table tbody .pmp-tier-row {
    border-bottom: 1px solid #f3f4f6;
    transition: background .15s;
}

.pmp-price-table tbody .pmp-tier-row:last-child {
    border-bottom: none;
}

.pmp-price-table tbody .pmp-tier-row:hover {
    background: #f9fafb;
}

.pmp-price-table td {
    padding: 12px 18px;
    color: #374151;
}

/* ── Active Tier Highlight ── */
.pmp-active-tier {
    background: #eef2ff !important;
    position: relative;
}

.pmp-active-tier::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #6366f1;
}

.pmp-active-tier td {
    color: #4f46e5 !important;
}

.pmp-active-tier .pmp-tier-price-cell strong {
    color: #4f46e5;
    font-size: 16px;
}

/* ── Tier Range ── */
.pmp-tier-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pmp-range-label {
    font-weight: 500;
}

.pmp-unlimited-badge {
    font-size: 11px;
    font-weight: 700;
    color: #6366f1;
    background: #eef2ff;
    padding: 1px 6px;
    border-radius: 4px;
}

.pmp-tier-price-cell strong {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
}

.pmp-tier-total {
    color: #6b7280;
    font-size: 13px;
}

/* ── Messages ── */
.pmp-select-variation-msg,
.pmp-no-tiers {
    padding: 16px 18px;
    background: #f9fafb;
    border: 1.5px dashed #d1d5db;
    border-radius: 10px;
    color: #9ca3af;
    font-size: 13px;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

/* ── Min Order Notice ── */
.pmp-min-order-notice {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #92400e;
    margin-top: 12px;
    font-family: 'Inter', sans-serif;
}

.pmp-min-order-notice::before {
    content: '⚠️';
    font-size: 14px;
}

/* ── Animations ── */
.pmp-current-price-display,
.pmp-table-container {
    animation: pmpFadeIn .3s ease;
}

.pmp-active-tier {
    animation: pmpHighlight .25s ease;
}

@keyframes pmpFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pmpHighlight {
    from { background: #c7d2fe; }
    to   { background: #eef2ff; }
}

/* ==========================================================================
   Frontend Custom Fields & Addons Styling
   ========================================================================== */

.pmp-addons-section {
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.02);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pmp-addon-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all .2s;
}

.pmp-addon-field-label {
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pmp-req-star {
    color: #ef4444;
    font-weight: 700;
}

.pmp-field-price-hint {
    font-size: 11px;
    font-weight: 600;
    color: #6366f1;
    background: #eef2ff;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

.pmp-addon-input-wrap {
    width: 100%;
}

.pmp-addon-select,
.pmp-addon-text-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    color: #1f2937;
    background: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.pmp-addon-select:focus,
.pmp-addon-text-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.pmp-addon-file-input {
    font-size: 13px;
    color: #4b5563;
}

.pmp-addon-file-input::file-selector-button {
    background: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all .2s;
    margin-right: 12px;
}

.pmp-addon-file-input::file-selector-button:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* ── Color & Option Swatches Container ── */
.pmp-color-swatches,
.pmp-radio-swatches {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    align-content: center !important;
    gap: 10px !important;
    padding: 6px 0 !important;
}

/* ── Color Circle Swatches ── */
body.single-product .woocommerce div.product form.cart .pmp-addons-section .pmp-addon-field .pmp-color-swatches button.pmp-color-swatch:not(.pmp-text-swatch):not(.pmp-img-swatch),
.pmp-color-swatch:not(.pmp-text-swatch):not(.pmp-img-swatch) {
    position: relative !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
    border-radius: 50% !important;
    border: 2px solid #cbd5e1 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    outline: none !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    transform: none !important;
}

body.single-product .woocommerce div.product form.cart .pmp-addons-section .pmp-addon-field .pmp-color-swatches button.pmp-color-swatch:not(.pmp-text-swatch):not(.pmp-img-swatch):hover,
.pmp-color-swatch:not(.pmp-text-swatch):not(.pmp-img-swatch):hover {
    transform: none !important;
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2) !important;
    z-index: 5 !important;
}

body.single-product .woocommerce div.product form.cart .pmp-addons-section .pmp-addon-field .pmp-color-swatches button.pmp-color-swatch:not(.pmp-text-swatch):not(.pmp-img-swatch).active,
.pmp-color-swatch:not(.pmp-text-swatch):not(.pmp-img-swatch).active {
    transform: none !important;
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.4) !important;
    z-index: 10 !important;
}

body.single-product .woocommerce div.product form.cart .pmp-addons-section .pmp-addon-field .pmp-color-swatches button.pmp-color-swatch:not(.pmp-text-swatch):not(.pmp-img-swatch).active::after,
.pmp-color-swatch:not(.pmp-text-swatch):not(.pmp-img-swatch).active::after {
    content: "\2714" !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: bold !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8) !important;
}

/* ── Text Button Swatches ── */
body.single-product .woocommerce div.product form.cart .pmp-addons-section .pmp-addon-field .pmp-color-swatches button.pmp-text-swatch,
.pmp-color-swatch.pmp-text-swatch {
    width: auto !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    border-radius: 6px !important;
    padding: 0 18px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #1e293b !important;
    background-color: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
    margin: 0 !important;
    transform: none !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

body.single-product .woocommerce div.product form.cart .pmp-addons-section .pmp-addon-field .pmp-color-swatches button.pmp-text-swatch:hover,
.pmp-color-swatch.pmp-text-swatch:hover {
    border-color: #4f46e5 !important;
    background-color: #f8fafc !important;
    color: #4f46e5 !important;
    transform: none !important;
}

body.single-product .woocommerce div.product form.cart .pmp-addons-section .pmp-addon-field .pmp-color-swatches button.pmp-text-swatch.active,
.pmp-color-swatch.pmp-text-swatch.active {
    background-color: #4f46e5 !important;
    border-color: #4f46e5 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25) !important;
    transform: none !important;
}

.pmp-swatch-tooltip {
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #1f2937;
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all .2s ease;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

.pmp-swatch-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1f2937;
}

.pmp-color-swatch:hover .pmp-swatch-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ── Error Highlight ── */
.pmp-addon-error {
    animation: pmpShake 0.4s ease;
}

.pmp-addon-error .pmp-addon-select,
.pmp-addon-error .pmp-addon-text-input {
    border-color: #ef4444;
    background: #fef2f2;
}

.pmp-addon-error .pmp-color-swatches,
.pmp-addon-error .pmp-radio-swatches {
    padding: 2px;
    border-radius: 6px;
    outline: 1.5px dashed #ef4444;
}

@keyframes pmpShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* ── Explicit Display for Text Inputs ── */
.pmp-addon-text-input {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    box-sizing: border-box !important;
}

/* ── Radio Buttons Swatches (Tag/Pill Style) ── */
body.single-product .woocommerce div.product form.cart .pmp-addons-section .pmp-addon-field .pmp-radio-swatches button.pmp-radio-swatch,
.pmp-radio-swatch {
    width: auto !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    background: #ffffff !important;
    border: 1.5px solid #d1d5db !important;
    border-radius: 6px !important;
    padding: 0 18px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #374151 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    outline: none !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
    margin: 0 !important;
    transform: none !important;
    text-transform: none !important;
    text-shadow: none !important;
}

body.single-product .woocommerce div.product form.cart .pmp-addons-section .pmp-addon-field .pmp-radio-swatches button.pmp-radio-swatch:hover,
.pmp-radio-swatch:hover {
    border-color: #4f46e5 !important;
    background: #f8fafc !important;
    color: #4f46e5 !important;
    transform: none !important;
}

body.single-product .woocommerce div.product form.cart .pmp-addons-section .pmp-addon-field .pmp-radio-swatches button.pmp-radio-swatch.active,
.pmp-radio-swatch.active {
    background: #4f46e5 !important;
    border-color: #4f46e5 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25) !important;
    transform: none !important;
}

/* ── Checkbox Addon Styling ── */
.pmp-addon-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    margin: 4px 0;
}

.pmp-addon-checkbox {
    width: 16px;
    height: 16px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
}

.pmp-addon-error .pmp-addon-checkbox-label {
    color: #ef4444;
    font-weight: 600;
}

/* ── Hidden Override (High Specificity) ── */
body.single-product .woocommerce div.product form.cart .pmp-addons-section .pmp-addon-field .pmp-color-swatches button.pmp-color-swatch.pmp-hidden,
body.single-product .woocommerce div.product form.cart .pmp-addons-section .pmp-addon-field .pmp-radio-swatches button.pmp-radio-swatch.pmp-hidden,
.pmp-addon-field.pmp-hidden,
.pmp-color-swatch.pmp-hidden,
.pmp-radio-swatch.pmp-hidden,
.pmp-hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    pointer-events: none !important;
}
