/* =========================================================
   Zohal Sales Mode v1.1 – UI
   Colors & sizes come from CSS variables (set by settings)
   ========================================================= */

.zsm-sales-mode {
    --zsm-primary: #0f766e;
    --zsm-primary-hover: #0d9488;
    --zsm-active-text: #ffffff;
    --zsm-inactive-text: #4b5563;
    --zsm-border: #d1d5db;
    --zsm-radius: 10px;
    --zsm-btn-height: 42px;
    --zsm-transition: 0.2s ease;
    margin: 12px 0 16px;
    direction: rtl;
    font-family: inherit;
}

.zsm-buttons {
    display: inline-flex;
    width: 100%;
    max-width: 320px;
    border: 1px solid var(--zsm-border);
    border-radius: var(--zsm-radius);
    overflow: hidden;
    background: #f9fafb;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    height: var(--zsm-btn-height);
}

.zsm-btn {
    flex: 1 1 50%;
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: transparent;
    color: var(--zsm-inactive-text);
    font-size: 14px;
    font-weight: 600;
    padding: 0 12px;
    height: 100%;
    cursor: pointer;
    transition: background var(--zsm-transition), color var(--zsm-transition);
    position: relative;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.zsm-btn:first-child {
    border-left: 1px solid var(--zsm-border);
}

.zsm-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

.zsm-btn.is-active {
    background: var(--zsm-primary);
    color: var(--zsm-active-text);
}

.zsm-btn.is-active:hover {
    background: var(--zsm-primary-hover);
}

.zsm-btn-price {
    display: block;
    font-size: 11px;
    font-weight: 500;
    opacity: 0.9;
    margin-top: 1px;
    line-height: 1.2;
}

.zsm-info {
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

.zsm-info-text {
    display: inline-block;
    background: #ecfdf5;
    color: #065f46;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
}

.zsm-sales-mode[data-mode="retail"] .zsm-info-text {
    background: #f3f4f6;
    color: #4b5563;
}

@media (max-width: 480px) {
    .zsm-buttons {
        max-width: 100%;
    }
    .zsm-btn {
        font-size: 13px;
        padding: 0 8px;
    }
}

/* Elementor / Loop */
.elementor-widget-woocommerce-products .zsm-sales-mode,
.elementor-loop-item .zsm-sales-mode,
.products .product .zsm-sales-mode {
    margin: 8px 0 10px;
}

.elementor-widget-woocommerce-products .zsm-buttons,
.elementor-loop-item .zsm-buttons,
.products .product .zsm-buttons {
    max-width: 100%;
}

.zsm-sales-mode.is-loading .zsm-buttons {
    opacity: 0.5;
    pointer-events: none;
}

.zsm-btn:focus-visible {
    outline: 2px solid var(--zsm-primary);
    outline-offset: 2px;
    z-index: 1;
}
