/*
 * Hamexio Product Options — NX1 visual integration
 * Uses the NX1 design tokens when the NX1 theme is active and keeps
 * compatible fallbacks so the plugin remains usable with other themes.
 */
.wcapo-wrap{
    --wcapo-ink:var(--nx1-ink,#111226);
    --wcapo-ink-soft:var(--nx1-ink-soft,#37384f);
    --wcapo-muted:var(--nx1-muted,#73758b);
    --wcapo-line:var(--nx1-line,#e7e7ef);
    --wcapo-surface:var(--nx1-surface,#fff);
    --wcapo-primary:var(--nx1-primary,#5b35d5);
    --wcapo-primary-dark:var(--nx1-primary-dark,#3b1fa8);
    --wcapo-accent:var(--nx1-accent,#eb2d8b);
    --wcapo-orange:var(--nx1-orange,#ff8a2a);
    --wcapo-success:var(--nx1-success,#13945a);
    --wcapo-danger:var(--nx1-danger,#d8334a);
    --wcapo-gradient:var(--nx1-gradient,linear-gradient(120deg,#5b35d5 0%,#d72b9b 56%,#ff8a2a 100%));
    width:100%;
    flex:1 0 100%;
    direction:rtl;
    text-align:right;
    font-family:"Vazirmatn","NX1 Sans",Tahoma,Arial,sans-serif;
    margin:8px 0 4px;
    padding:16px;
    border:1px solid var(--wcapo-line);
    border-radius:14px;
    background:#f8f7fc;
    color:var(--wcapo-ink);
    font-size:11px;
    line-height:1.75;
}
.wcapo-wrap,.wcapo-wrap *{box-sizing:border-box}

/* Groups intentionally feel like native sections inside the NX1 buy box. */
.wcapo-group{
    position:relative;
    margin:0;
    padding:0;
    border:0;
    background:transparent;
    box-shadow:none;
}
.wcapo-group + .wcapo-group{
    margin-top:16px;
    padding-top:16px;
    border-top:1px solid var(--wcapo-line);
}
.wcapo-group-title{
    display:flex;
    align-items:center;
    gap:8px;
    margin:0 0 13px;
    padding:0;
    border:0;
    color:var(--wcapo-ink);
    font-family:inherit;
    font-size:12px;
    font-weight:800;
    line-height:1.7;
    letter-spacing:0;
}
.wcapo-group-title::before{
    width:8px;
    height:8px;
    flex:0 0 8px;
    border-radius:3px;
    background:var(--wcapo-gradient);
    box-shadow:0 3px 10px rgb(91 53 213 / 18%);
    content:"";
}


.wcapo-group-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin:0 0 13px;
}
.wcapo-group-head .wcapo-group-title{
    flex:1 1 auto;
    min-width:0;
    margin:0;
}
.wcapo-base-price{
    flex:0 0 auto;
    display:flex;
    align-items:center;
    gap:6px;
    margin:0;
    padding:0;
    border:0;
    white-space:nowrap;
}
.wcapo-base-price-label{
    color:var(--wcapo-muted);
    font-size:10.5px;
    font-weight:750;
    line-height:1.6;
}
.wcapo-base-price-value{
    color:var(--wcapo-ink);
    font-size:14px;
    font-weight:900;
    line-height:1.3;
    letter-spacing:-0.01em;
    white-space:nowrap;
}
.wcapo-base-price-value .woocommerce-Price-amount,
.wcapo-base-price-value bdi{
    font:inherit;
}

.wcapo-field{margin:0 0 13px}
.wcapo-field:last-child{margin-bottom:0}
.wcapo-label{
    display:flex;
    align-items:center;
    gap:5px;
    margin:0 0 7px;
    color:var(--wcapo-ink);
    font-family:inherit;
    font-size:11px;
    font-weight:800;
    line-height:1.7;
}
.wcapo-label .required{
    width:16px;
    height:16px;
    display:inline-grid;
    place-items:center;
    border-radius:999px;
    background:rgb(235 45 139 / 9%);
    color:var(--wcapo-accent);
    font-size:11px;
    line-height:1;
    text-decoration:none;
}
.wcapo-description{
    margin:-2px 0 7px;
    color:var(--wcapo-muted);
    font-size:11px;
    line-height:1.9;
}
.wcapo-description p{margin:0}

/* Form controls mirror NX1's native variation controls. */
.wcapo-field input[type=text],
.wcapo-field input[type=email],
.wcapo-field input[type=number],
.wcapo-field input[type=date],
.wcapo-field input[type=file],
.wcapo-field textarea,
.wcapo-field select{
    width:100%;
    max-width:100%;
    min-height:48px;
    margin:0;
    padding:0 12px;
    border:1px solid var(--wcapo-line);
    border-radius:11px;
    background:var(--wcapo-surface);
    color:var(--wcapo-ink);
    font:inherit;
    font-size:11px;
    line-height:1.6;
    box-shadow:none;
    outline:0;
    transition:border-color 160ms ease,box-shadow 160ms ease,background-color 160ms ease;
}
.wcapo-field textarea{
    min-height:96px;
    padding-block:11px;
    resize:vertical;
}
.wcapo-field select{cursor:pointer;padding-inline:12px 34px}
.wcapo-field input::placeholder,
.wcapo-field textarea::placeholder{color:#aaa7b3;opacity:1}
.wcapo-field input:focus,
.wcapo-field textarea:focus,
.wcapo-field select:focus{
    border-color:rgb(91 53 213 / 48%);
    background:#fff;
    box-shadow:0 0 0 4px rgb(91 53 213 / 8%);
}
.wcapo-field input[type=color]{
    width:72px;
    height:46px;
    padding:4px;
    border:1px solid var(--wcapo-line);
    border-radius:11px;
    background:#fff;
    cursor:pointer;
}
.wcapo-field input[type=file]{
    height:auto;
    min-height:48px;
    padding:7px 9px;
    background:#fff;
    color:var(--wcapo-muted);
}
.wcapo-field input[type=file]::file-selector-button{
    min-height:34px;
    margin:0 0 0 10px;
    padding:0 13px;
    border:0;
    border-radius:9px;
    background:#f0edfb;
    color:var(--wcapo-primary);
    font:inherit;
    font-size:10px;
    font-weight:800;
    cursor:pointer;
    transition:background 160ms ease,color 160ms ease,transform 160ms ease;
}
.wcapo-field input[type=file]::file-selector-button:hover{
    background:var(--wcapo-primary);
    color:#fff;
}
.wcapo-file-note{
    display:flex;
    align-items:center;
    gap:5px;
    margin-top:6px;
    color:var(--wcapo-muted);
    font-size:8.5px;
}
.wcapo-file-note::before{
    width:5px;
    height:5px;
    flex:0 0 5px;
    border-radius:50%;
    background:var(--wcapo-primary);
    content:"";
}

/* Radio and checkbox options become NX1-style selectable cards. */
.wcapo-choices{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;
}
.wcapo-choice{
    position:relative;
    min-width:0;
    min-height:48px;
    display:flex;
    align-items:center;
    gap:8px;
    margin:0;
    padding:9px 10px;
    overflow:hidden;
    border:1px solid var(--wcapo-line);
    border-radius:11px;
    background:#fff;
    color:var(--wcapo-ink-soft);
    cursor:pointer;
    font-family:inherit;
    font-size:10px;
    font-weight:650;
    line-height:1.6;
    transition:border-color 160ms ease,background-color 160ms ease,color 160ms ease,box-shadow 160ms ease,transform 160ms ease;
}
.wcapo-choice:hover{
    border-color:rgb(91 53 213 / 24%);
    background:#fdfcff;
    color:var(--wcapo-ink);
    transform:translateY(-1px);
}
.wcapo-choice.is-selected{
    border-color:rgb(91 53 213 / 48%);
    background:#f3f0fd;
    color:var(--wcapo-primary);
    box-shadow:0 0 0 3px rgb(91 53 213 / 6%);
}
.wcapo-choice input[type=radio],
.wcapo-choice input[type=checkbox]{
    width:17px;
    height:17px;
    flex:0 0 17px;
    margin:0;
    accent-color:var(--wcapo-primary);
}
.wcapo-choice span{min-width:0}

.wcapo-heading{
    display:flex;
    align-items:center;
    gap:7px;
    margin:2px 0 8px;
    color:var(--wcapo-ink);
    font-family:inherit;
    font-size:11px;
    font-weight:850;
}
.wcapo-heading::before{
    width:3px;
    height:18px;
    border-radius:999px;
    background:var(--wcapo-primary);
    content:"";
}

/* Price block follows the NX1 support/summary card language. */
.wcapo-price-summary{
    position:relative;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
    margin-top:16px;
    padding:11px;
    overflow:hidden;
    border:1px solid #e7e2f8;
    border-radius:14px;
    background:linear-gradient(135deg,#f6f3ff,#fff5fa);
    font-size:11px;
}
.wcapo-price-summary::before{
    position:absolute;
    inset-block:0;
    inset-inline-start:0;
    width:4px;
    background:var(--wcapo-gradient);
    content:"";
}
.wcapo-extra-label,
.wcapo-total-label{
    min-width:0;
    min-height:50px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    padding:9px 10px;
    border:1px solid rgb(91 53 213 / 7%);
    border-radius:11px;
    background:rgb(255 255 255 / 82%);
    color:var(--wcapo-muted);
}
.wcapo-summary-label-text{
    color:var(--wcapo-muted);
    font-size:11px;
    font-weight:800;
    line-height:1.7;
}
.wcapo-price-summary strong{
    min-width:0;
    color:var(--wcapo-ink);
    font-size:13px;
    font-weight:900;
    line-height:1.35;
    white-space:nowrap;
}
.wcapo-price-summary strong .woocommerce-Price-amount,
.wcapo-price-summary strong bdi{
    font:inherit;
}
.wcapo-total-label strong{color:var(--wcapo-primary)}
.wcapo-conditional[style*="display: none"]{margin:0!important}

/* NX1-specific integration: sit cleanly inside the theme's flex cart box. */
.single-product .woocommerce div.product form.cart > .wcapo-wrap{
    order:1;
    flex-basis:100%;
}
.single-product .woocommerce div.product form.cart > .quantity,
.single-product .woocommerce div.product form.cart > .single_add_to_cart_button{
    order:3;
}
.single-product .woocommerce div.product form.cart > .single_variation_wrap{
    order:2;
}
.single-product .woocommerce div.product form.cart .single_variation_wrap .wcapo-wrap{
    width:100%;
}

@media(max-width:680px){
    .wcapo-wrap{padding:12px;border-radius:12px}
    .wcapo-group-head{gap:8px}
    .wcapo-base-price{gap:4px}
    .wcapo-base-price-label{font-size:9.5px}
    .wcapo-base-price-value{font-size:12px}
    .wcapo-group + .wcapo-group{margin-top:13px;padding-top:13px}
    .wcapo-choices{grid-template-columns:1fr}
    .wcapo-price-summary{grid-template-columns:1fr}
    .wcapo-choice{min-height:46px}
}
