/**
 * Custom Product Page Styles - Kalashahr
 * Based on product-gutenberg-style-refactored.html
 * 
 * @package Woodmart Child
 * @version 1.0.0
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --ks-bg: #f6f7fb;
    --ks-surface: #ffffff;
    --ks-muted: #6b7280;
    --ks-text: #111827;
    --ks-border: #e5e7eb;
    --ks-primary: #1f2937;
    --ks-accent: #111827;
    --ks-soft: #f2f4f7;
    --ks-shadow: 0 12px 30px rgba(16, 24, 40, .08);
    --ks-radius: 16px;
    --ks-radius-sm: 12px;
    --ks-container: 1600px;
    
    /* Sticky positioning heights */
    --ks-topbar-height: 32px;
    --ks-tabs-height: 52px;
    --ks-admin-bar-height: 0px;
    --ks-sticky-offset: calc(var(--ks-topbar-height) + var(--ks-tabs-height));
    
    /* Z-index system */
    --ks-z-base: 1;
    --ks-z-dropdown: 10;
    --ks-z-sticky: 20;
    --ks-z-tabs: 40;
    --ks-z-topbar: 50;
    --ks-z-modal: 100;
    --ks-z-tooltip: 200;
    
    /* Spacing system */
    --ks-spacing-xs: 4px;
    --ks-spacing-sm: 8px;
    --ks-spacing-md: 12px;
    --ks-spacing-lg: 16px;
    --ks-spacing-xl: 24px;
    --ks-spacing-2xl: 32px;
    --ks-spacing-3xl: 48px;

    /* Action toolbar */
    --ks-action-size: 44px;
    --ks-action-icon: 20px;
    --ks-action-wishlist: #e11d48;
    --ks-action-wishlist-bg: #fff1f2;
    --ks-action-wishlist-border: #fecdd3;
    --ks-action-compare: #2563eb;
    --ks-action-compare-bg: #eff6ff;
    --ks-action-compare-border: #bfdbfe;
    --ks-action-reviews: #059669;
    --ks-action-reviews-bg: #ecfdf5;
    --ks-action-share: #6366f1;
    --ks-action-share-bg: #eef2ff;
    --ks-action-radius: 10px;
}

/* ============================================
   Base Styles
   ============================================ */
.ks-custom-product {
    background: var(--ks-bg);
    color: var(--ks-text);
    line-height: 1.7;
}

.ks-container {
    max-width: var(--ks-container);
    margin: 0 auto;
    padding: 0 16px;
}

/* Accessibility */
.ks-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.ks-custom-product :focus-visible {
    outline: 3px solid rgba(17, 24, 39, .35);
    outline-offset: 3px;
    border-radius: 10px;
}

/* ============================================
   Product Header - Main Layout
   ============================================ */
.ks-product-header {
    display: flex;
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--ks-spacing-xl);
    margin-bottom: var(--ks-spacing-2xl);
    padding-top: var(--ks-spacing-lg);
}

.ks-product-main-section {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    background: var(--ks-surface);
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    box-shadow: 0 8px 20px rgba(16, 24, 40, .05);
    overflow: hidden;
}

/* Product Details (Left Section) */
.ks-product-details {
    flex: 0 0 55%;
    display: flex;
    flex-direction: column;
    padding: var(--ks-spacing-lg) var(--ks-spacing-md) var(--ks-spacing-2xl) var(--ks-spacing-lg);
    width: 55%;
    border-left: 1px solid var(--ks-border);
    box-sizing: border-box;
}

.ks-product-info-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: var(--ks-spacing-lg);
}

/* Product Gallery (Right Section) */
.ks-product-gallery-section {
    flex: 0 0 45%;
    display: flex;
    flex-direction: column;
    padding: var(--ks-spacing-lg) var(--ks-spacing-lg) var(--ks-spacing-2xl) var(--ks-spacing-md);
    width: 45%;
    box-sizing: border-box;
    overflow: visible;
}

/* Purchase Card (Sidebar) */
.ks-product-purchase {
    flex: 0 0 309px;
    min-width: 309px;
    position: sticky;
    top: var(--ks-admin-bar-height);
    align-self: flex-start;
}

/* ============================================
   Product Title
   ============================================ */
.ks-product-title-main {
    margin: 0;
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    font-weight: 800;
    color: var(--ks-primary);
    line-height: 1.45;
    padding-bottom: var(--ks-spacing-md);
    border-bottom: 1px solid var(--ks-border);
}

/* ============================================
   Reviews Link
   ============================================ */
.ks-reviews-link {
    display: flex;
    align-items: center;
    gap: var(--ks-spacing-sm);
    padding: var(--ks-spacing-md) 0;
    border-bottom: 1px solid var(--ks-border);
    cursor: pointer;
    transition: opacity 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.ks-reviews-link:hover {
    opacity: 0.8;
}

.ks-reviews-title {
    margin: 0;
    font-weight: 700;
    font-size: 13px;
    color: var(--ks-primary);
}

.ks-reviews-count {
    margin: 0;
    font-weight: 700;
    font-size: 11px;
    color: #2563eb;
}

/* ============================================
   Color/Variant Selector
   ============================================ */
.ks-variations-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--ks-spacing-md);
}

.ks-color-selector {
    margin: 0;
    padding: var(--ks-spacing-md) 0;
    border-bottom: 1px solid var(--ks-border);
}

.ks-color-label {
    display: flex;
    align-items: center;
    gap: var(--ks-spacing-md);
    margin-bottom: var(--ks-spacing-md);
    font-size: 14px;
    color: var(--ks-primary);
}

.ks-color-label strong {
    font-weight: 700;
    margin-right: 8px;
}

.ks-color-options {
    display: flex;
    gap: var(--ks-spacing-md);
    flex-wrap: wrap;
    padding-bottom: 0;
    border-bottom: none;
}

.ks-color-option {
    display: flex;
    align-items: center;
    gap: var(--ks-spacing-sm);
    padding: var(--ks-spacing-xs) var(--ks-spacing-sm);
    border: 2px solid var(--ks-border);
    border-radius: var(--ks-spacing-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--ks-surface);
}

.ks-color-option:hover {
    border-color: var(--ks-primary);
}

.ks-color-option.active {
    border-color: var(--ks-primary);
    background: rgba(17, 24, 39, .04);
}

.ks-color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    flex-shrink: 0;
    position: relative;
}

.ks-color-option.active .ks-color-swatch::after {
    content: "✓";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.ks-color-name {
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    white-space: nowrap;
}

/* ============================================
   Kalashahr Box (Installment)
   ============================================ */
.ks-kalashahr-box {
    margin: 0;
    padding: var(--ks-spacing-md) var(--ks-spacing-lg);
    border-radius: var(--ks-radius-sm);
    border: 1px solid var(--ks-border);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.ks-kalashahr-header {
    display: flex;
    align-items: center;
    gap: var(--ks-spacing-xs);
    margin-bottom: var(--ks-spacing-xs);
    font-weight: 600;
    font-size: 12px;
    color: var(--ks-primary);
}

.ks-kalashahr-header img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.ks-kalashahr-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ks-kalashahr-list li {
    display: flex;
    align-items: center;
    gap: var(--ks-spacing-xs);
    font-size: 11px;
    color: #4b5563;
    line-height: 1.6;
    padding-right: var(--ks-spacing-xs);
}

.ks-kalashahr-list li::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6b7280;
    flex-shrink: 0;
}

/* ============================================
   Short Description
   ============================================ */
.ks-short-description {
    padding: var(--ks-spacing-md) 0;
    font-size: 14px;
    color: #374151;
    line-height: 1.7;
}

/* ============================================
   Gallery
   ============================================ */
.ks-gallery-container {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: visible;
}

.ks-gallery-main {
    position: relative;
    z-index: 0;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: #f9fafb;
    border: 1px solid var(--ks-border);
    cursor: zoom-in;
}

.ks-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    user-select: none;
}

.ks-gallery-zoom {
    position: absolute;
    left: calc(100% + 10px);
    top: 0;
    width: 150%;
    height: 550px;
    background: var(--ks-surface);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(16, 24, 40, .15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: var(--ks-z-tooltip);
    overflow: hidden;
    pointer-events: none;
}

.ks-gallery-main:hover .ks-gallery-zoom {
    opacity: 1;
    visibility: visible;
}

.ks-gallery-thumbnails {
    display: flex;
    gap: var(--ks-spacing-md);
    margin-top: var(--ks-spacing-lg);
    justify-content: center;
    flex-wrap: wrap;
}

.ks-gallery-thumb {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    border: 2px solid var(--ks-border);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f9fafb;
}

.ks-gallery-thumb:hover {
    border-color: var(--ks-primary);
    transform: scale(1.05);
}

.ks-gallery-thumb.active {
    border-color: var(--ks-primary);
    border-width: 3px;
}

.ks-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ============================================
   Action Buttons (gallery toolbar)
   ============================================ */
.ks-action-toolbar {
    position: relative;
    z-index: var(--ks-z-sticky);
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--ks-spacing-lg);
    overflow: visible;
}

.ks-action-buttons {
    display: inline-flex;
    gap: var(--ks-spacing-sm);
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

/* WoodMart global button reset (:is(.btn, button, …) uses --btn-* vars) */
.ks-custom-product .ks-action-buttons {
    --btn-brd-radius: var(--ks-action-radius);
    --btn-padding: 0;
    --btn-height: var(--ks-action-size);
    --btn-font-size: 0;
    --btn-transform: none;
    --btn-font-weight: 400;
    --btn-box-shadow: none;
    --btn-bgcolor: transparent;
    --btn-brd-width: 0;
    --btn-brd-color: transparent;
}

.ks-action-proxies {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

.ks-custom-product .ks-action-buttons button.ks-action-btn {
    position: relative;
    width: var(--ks-action-size);
    height: var(--ks-action-size);
    min-height: var(--ks-action-size);
    max-height: var(--ks-action-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0;
    margin: 0;
    color: var(--ks-muted);
    background-color: var(--ks-surface);
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-action-radius);
    text-transform: none;
    font-size: 0;
    font-weight: 400;
    line-height: 1;
    vertical-align: middle;
    cursor: pointer;
    transition:
        background-color 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(16, 24, 40, .08);
    -webkit-appearance: none;
    appearance: none;
}

.ks-custom-product .ks-action-buttons button.ks-action-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, .45) 0%, transparent 70%);
    transition: opacity 0.22s ease;
    pointer-events: none;
}

.ks-custom-product .ks-action-buttons button.ks-action-btn:hover,
.ks-custom-product .ks-action-buttons button.ks-action-btn:focus-visible {
    z-index: var(--ks-z-tooltip);
    transform: translateY(-1px);
}

.ks-custom-product .ks-action-buttons button.ks-action-btn:active {
    transform: translateY(0) scale(0.94);
}

.ks-custom-product .ks-action-buttons button.ks-action-btn:hover::after,
.ks-custom-product .ks-action-buttons button.ks-action-btn:focus-visible::after {
    opacity: 1;
}

.ks-custom-product .ks-action-buttons button.ks-share-btn:hover,
.ks-custom-product .ks-action-buttons button.ks-share-btn:focus-visible {
    background: var(--ks-action-share-bg);
    color: var(--ks-action-share);
    border-color: rgba(99, 102, 241, .18);
    box-shadow: 0 4px 10px rgba(99, 102, 241, .12);
}

.ks-custom-product .ks-action-buttons button.ks-reviews-action-btn:hover,
.ks-custom-product .ks-action-buttons button.ks-reviews-action-btn:focus-visible {
    background: var(--ks-action-reviews-bg);
    color: var(--ks-action-reviews);
    border-color: rgba(5, 150, 105, .18);
    box-shadow: 0 4px 10px rgba(5, 150, 105, .1);
}

.ks-custom-product .ks-action-buttons button.ks-compare-btn:hover,
.ks-custom-product .ks-action-buttons button.ks-compare-btn:focus-visible {
    background: var(--ks-action-compare-bg);
    color: var(--ks-action-compare);
    border-color: rgba(37, 99, 235, .16);
    box-shadow: 0 4px 10px rgba(37, 99, 235, .1);
}

.ks-custom-product .ks-action-buttons button.ks-wishlist-btn:hover,
.ks-custom-product .ks-action-buttons button.ks-wishlist-btn:focus-visible {
    background: var(--ks-action-wishlist-bg);
    color: var(--ks-action-wishlist);
    border-color: rgba(225, 29, 72, .16);
    box-shadow: 0 4px 10px rgba(225, 29, 72, .1);
}

.ks-custom-product .ks-action-buttons button.ks-compare-btn.active {
    background: var(--ks-action-compare-bg);
    color: var(--ks-action-compare);
    border-color: var(--ks-action-compare-border);
    box-shadow: 0 2px 8px rgba(37, 99, 235, .14);
}

.ks-custom-product .ks-action-buttons button.ks-compare-btn.active:hover,
.ks-custom-product .ks-action-buttons button.ks-compare-btn.active:focus-visible {
    background: #dbeafe;
    border-color: #93c5fd;
    box-shadow: 0 4px 12px rgba(37, 99, 235, .18);
}

.ks-custom-product .ks-action-buttons button.ks-wishlist-btn.active {
    background: var(--ks-action-wishlist-bg);
    color: var(--ks-action-wishlist);
    border-color: var(--ks-action-wishlist-border);
    box-shadow: 0 2px 8px rgba(225, 29, 72, .12);
}

.ks-custom-product .ks-action-buttons button.ks-wishlist-btn.active:hover,
.ks-custom-product .ks-action-buttons button.ks-wishlist-btn.active:focus-visible {
    background: #ffe4e6;
    border-color: #fda4af;
    box-shadow: 0 4px 12px rgba(225, 29, 72, .16);
}

.ks-action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--ks-action-icon);
    height: var(--ks-action-icon);
    flex-shrink: 0;
    line-height: 0;
    pointer-events: none;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.ks-custom-product .ks-action-buttons button.ks-action-btn:hover .ks-action-icon,
.ks-custom-product .ks-action-buttons button.ks-action-btn:focus-visible .ks-action-icon {
    transform: scale(1.06);
}

.ks-custom-product .ks-action-buttons button.ks-action-btn:active .ks-action-icon {
    transform: scale(0.96);
}

.ks-custom-product .ks-action-btn .ks-action-icon svg {
    display: block;
    width: var(--ks-action-icon);
    height: var(--ks-action-icon);
    opacity: 1 !important;
    visibility: visible !important;
    transition: stroke 0.22s ease, fill 0.22s ease;
}

.ks-custom-product .ks-wishlist-btn.active .ks-action-icon svg path {
    fill: currentColor;
    stroke: currentColor;
}

.ks-custom-product .ks-compare-btn.active .ks-action-icon svg path {
    stroke-width: 2.25;
}

.ks-action-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    z-index: var(--ks-z-tooltip);
    transform: translateX(-50%) translateY(4px);
    background: rgba(17, 24, 39, .92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    color: #fff;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 20px rgba(16, 24, 40, .2);
    pointer-events: none;
}

.ks-action-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: rgba(17, 24, 39, .92);
}

.ks-custom-product .ks-action-buttons button.ks-action-btn:hover .ks-action-tooltip,
.ks-custom-product .ks-action-buttons button.ks-action-btn:focus-visible .ks-action-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   Purchase Card
   ============================================ */
.ks-purchase-card {
    background: var(--ks-surface);
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    padding: var(--ks-spacing-lg) var(--ks-spacing-xl) var(--ks-spacing-xl);
    box-shadow: 0 8px 20px rgba(16, 24, 40, .05);
}

.ks-purchase-countdown {
    margin-bottom: var(--ks-spacing-md);
    direction: ltr;
    text-align: center;
}

.ks-purchase-countdown .wd-countdown-timer {
    margin-bottom: 0;
}

.ks-purchase-countdown .wd-product-countdown .wd-timer {
    justify-content: center;
    gap: 6px;
}

/* فقط ساعت:دقیقه:ثانیه — بدون روز */
.ks-purchase-countdown .wd-timer .wd-timer-days,
.ks-purchase-countdown .wd-timer .wd-sep {
    display: none !important;
}

.ks-purchase-countdown .wd-timer .wd-timer-text {
    display: none !important;
}

.ks-purchase-countdown .wd-timer .wd-item {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
}

.ks-purchase-countdown .wd-timer .wd-item:not(:last-child)::after {
    content: ":";
    margin: 0 4px;
    font-size: 13px;
    font-weight: 300;
    color: #9ca3af;
    line-height: 1.2;
}

.ks-seller {
    margin-top: var(--ks-spacing-sm);
    padding: var(--ks-spacing-sm) var(--ks-spacing-md);
    border-radius: var(--ks-radius-sm);
    background: #fbfbff;
    border: 1px solid rgba(229, 231, 235, .9);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ks-seller-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ks-spacing-sm);
    color: #374151;
    font-size: 12px;
}

.ks-seller-row strong {
    font-weight: 700;
}

.ks-low-stock {
    color: #dc2626 !important;
}

/* ============================================
   Price Styles
   ============================================ */
.ks-price {
    margin-top: var(--ks-spacing-lg);
    padding: var(--ks-spacing-sm) var(--ks-spacing-md);
    border-radius: var(--ks-radius-sm);
    background: #fff;
    border: 1px solid rgba(229, 231, 235, .9);
}

.ks-discount-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #dc2626;
    color: #fff;
    border-radius: 999px;
    padding: 4px 8px;
    font-weight: 700;
    font-size: 11px;
}

.ks-price-row {
    margin-top: var(--ks-spacing-sm);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--ks-spacing-sm);
    flex-wrap: wrap;
}

.ks-old {
    color: #9ca3af;
    text-decoration: line-through;
    font-weight: 600;
    font-size: 12px;
}

.ks-price-current {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.ks-new {
    font-size: 18px;
    font-weight: 900;
    color: var(--ks-primary);
}

.ks-currency {
    color: var(--ks-muted);
    font-weight: 600;
    font-size: 11px;
    margin-right: 4px;
}

.ks-purchase-note {
    margin: var(--ks-spacing-sm) 2px 0;
    font-weight: 600;
    font-size: 11px;
    color: var(--ks-muted);
    text-align: center;
}

/* ============================================
   Add to Cart Wrapper
   ============================================ */
.ks-add-to-cart-wrapper {
    margin-top: var(--ks-spacing-md);
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .single_add_to_cart_button,
body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .single_add_to_cart_button.button.alt,
body.kalashahr-custom-pdp .ks-add-to-cart-wrapper button[type="submit"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 12px 24px !important;
    background: linear-gradient(135deg, var(--ks-primary) 0%, #0f172a 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--ks-radius-sm) !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.15) !important;
    position: relative !important;
    overflow: hidden !important;
    width: 100% !important;
    transform: translateY(0) !important;
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .single_add_to_cart_button::before,
body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .single_add_to_cart_button.button.alt::before,
body.kalashahr-custom-pdp .ks-add-to-cart-wrapper button[type="submit"]::before,
body.kalashahr-custom-pdp .woocommerce .ks-add-to-cart-wrapper .single_add_to_cart_button::before,
body.kalashahr-custom-pdp .woocommerce form.cart .ks-add-to-cart-wrapper .single_add_to_cart_button::before,
body.kalashahr-custom-pdp .woocommerce .ks-add-to-cart-wrapper .single_add_to_cart_button.button.alt::before {
    content: "" !important;
    position: absolute !important;
    inset: auto !important;
    top: 0 !important;
    right: auto !important;
    bottom: auto !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 1 !important;
    z-index: 1 !important;
    border-radius: inherit !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent) !important;
    background-color: transparent !important;
    box-shadow: none !important;
    transition: left 0.5s ease !important;
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .single_add_to_cart_button:hover::before,
body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .single_add_to_cart_button.button.alt:hover::before,
body.kalashahr-custom-pdp .ks-add-to-cart-wrapper button[type="submit"]:hover::before,
body.kalashahr-custom-pdp .woocommerce .ks-add-to-cart-wrapper .single_add_to_cart_button:hover::before,
body.kalashahr-custom-pdp .woocommerce form.cart .ks-add-to-cart-wrapper .single_add_to_cart_button:hover::before,
body.kalashahr-custom-pdp .woocommerce .ks-add-to-cart-wrapper .single_add_to_cart_button.button.alt:hover::before {
    left: 100% !important;
    opacity: 1 !important;
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .single_add_to_cart_button:hover,
body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .single_add_to_cart_button.button.alt:hover,
body.kalashahr-custom-pdp .ks-add-to-cart-wrapper button[type="submit"]:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.25) !important;
    background: linear-gradient(135deg, #0f172a 0%, var(--ks-primary) 100%) !important;
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .single_add_to_cart_button:active,
body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .single_add_to_cart_button.button.alt:active,
body.kalashahr-custom-pdp .ks-add-to-cart-wrapper button[type="submit"]:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.2) !important;
}

/* Hide default variation form styles */
.ks-add-to-cart-wrapper .variations {
    display: none !important;
}

.ks-add-to-cart-wrapper .reset_variations {
    display: none !important;
}

/* ============================================
   Button Styles
   ============================================ */
.ks-btn {
    border: 1px solid rgba(17, 24, 39, .15);
    background: rgba(17, 24, 39, .04);
    color: var(--ks-primary);
    padding: var(--ks-spacing-md);
    border-radius: var(--ks-radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: var(--ks-spacing-md);
    transition: transform .12s ease, background .12s ease;
}

.ks-btn:hover {
    transform: translateY(-1px);
    background: rgba(17, 24, 39, .07);
}

.ks-btn:active {
    transform: translateY(0px);
}

.ks-btn-primary {
    background: var(--ks-primary);
    color: #fff;
    border-color: var(--ks-primary);
    justify-content: center;
    width: 100%;
    padding: 14px;
    border-radius: var(--ks-radius-sm);
    box-shadow: 0 8px 20px rgba(17, 24, 39, .18);
    font-size: 14px;
}

.ks-btn-primary:hover {
    background: #0b1220;
}

.ks-btn-disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    width: 100%;
    justify-content: center;
}

/* ============================================
   Quick Info Bar
   ============================================ */
.ks-quick-info-bar {
    width: 100%;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-top: 1px solid var(--ks-border);
    border-bottom: 1px solid var(--ks-border);
    margin: var(--ks-spacing-2xl) 0 var(--ks-spacing-xl);
    padding: var(--ks-spacing-lg) 0;
}

.ks-quick-info-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--ks-spacing-lg);
    align-items: center;
}

.ks-quick-info-item {
    display: flex;
    align-items: center;
    gap: var(--ks-spacing-md);
    padding: var(--ks-spacing-sm);
    border-radius: var(--ks-radius-sm);
    transition: all 0.2s ease;
}

.ks-quick-info-item:hover {
    background: rgba(17, 24, 39, .03);
    transform: translateY(-2px);
}

.ks-quick-info-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 24, 39, .05);
    border-radius: 10px;
    color: var(--ks-primary);
}

.ks-quick-info-icon svg {
    width: 22px;
    height: 22px;
    display: block;
}

.ks-quick-info-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ks-quick-info-content strong {
    font-size: 13px;
    font-weight: 800;
    color: var(--ks-primary);
    line-height: 1.4;
}

.ks-quick-info-content span {
    font-size: 11px;
    color: var(--ks-muted);
    font-weight: 600;
}

/* ============================================
   WordPress Admin Bar Support
   ============================================ */
body.admin-bar {
    --ks-admin-bar-height: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar {
        --ks-admin-bar-height: 46px;
    }
}

/* ============================================
   Sticky Tabs - Modern 2026 Minimal Design
   Offset follows Woodmart sticky header (hide-on-scroll); see body.ks-whb-header-collapsed
   ============================================ */
.ks-tabs-wrap {
    position: sticky;
    top: calc(var(--ks-topbar-height) + var(--ks-admin-bar-height) + var(--ks-spacing-sm));
    transition: top 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: var(--ks-z-tabs);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    margin: var(--ks-spacing-2xl) calc(-1 * var(--ks-spacing-lg)) var(--ks-spacing-xl);
    padding: 0 var(--ks-spacing-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.ks-whb-header-collapsed .ks-tabs-wrap {
    top: var(--ks-admin-bar-height);
}

@media (prefers-reduced-motion: reduce) {
    .ks-tabs-wrap {
        transition-duration: 0.01ms;
    }
}

.ks-tabs {
    display: flex;
    gap: 32px;
    align-items: center;
    padding: 0;
    margin: 0;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ks-tabs::-webkit-scrollbar {
    display: none;
}

.ks-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 4px;
    cursor: pointer;
    white-space: nowrap;
    color: #64748b;
    font-weight: 500;
    font-size: 13px;
    letter-spacing: -0.01em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0;
    background: transparent;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    gap: 8px;
    line-height: 1;
    vertical-align: middle;
    margin-bottom: var(--li-mb, 0);
}

/* Override any global li:last-child styles for tabs */
.ks-tabs li:last-child {
    margin-bottom: var(--li-mb, 0)
}

.ks-tab:hover {
    color: #1e293b;
    background: transparent;
}

.ks-tab:active {
    transform: scale(0.98);
}

.ks-tab[aria-selected="true"] {
    color: var(--wd-primary-color, var(--ks-primary));
    font-weight: 600;
    background: transparent;
}

.ks-tab[aria-selected="true"]::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2.5px;
    background: var(--wd-primary-color, var(--ks-primary));
    border-radius: 2px 2px 0 0;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 100%;
        opacity: 1;
    }
}

/* Tab Badge for Comments – رنگ سازمانی */
.ks-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: color-mix(in srgb, var(--wd-primary-color, var(--ks-primary)) 12%, transparent);
    color: var(--wd-primary-color, var(--ks-primary));
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    line-height: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    margin-right: 0;
}

.ks-tab[aria-selected="true"] .ks-tab-badge {
    background: var(--wd-primary-color, var(--ks-primary));
    color: white;
}

/* Focus states for accessibility – رنگ سازمانی */
.ks-tab:focus-visible {
    outline: 2px solid var(--wd-primary-color, var(--ks-primary));
    outline-offset: 2px;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .ks-tabs-wrap {
        margin: var(--ks-spacing-xl) calc(-1 * var(--ks-spacing-md)) var(--ks-spacing-lg);
        padding: 0 var(--ks-spacing-md);
    }
    
    .ks-tabs {
        gap: 24px;
    }
    
    .ks-tab {
        height: 40px;
        font-size: 12px;
    }
    
    .ks-tab-badge {
        min-width: 18px;
        height: 18px;
        font-size: 10px;
        padding: 0 5px;
    }
}

/* ============================================
   Content Section
   ============================================ */
.ks-content-section {
    margin-top: var(--ks-spacing-2xl);
    display: flex;
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--ks-spacing-xl);
}

.ks-content-main {
    display: flex;
    flex: 1 1 0;
    min-width: 568px;
    flex-direction: column;
    gap: var(--ks-spacing-lg);
}

.ks-content-purchase {
    flex: 0 0 309px;
    min-width: 309px;
    position: sticky;
    top: calc(var(--ks-topbar-height) + var(--ks-tabs-height) + var(--ks-admin-bar-height) + var(--ks-spacing-lg));
    align-self: flex-start;
}

/* ============================================
   Cards and Sections
   ============================================ */
.ks-card {
    background: var(--ks-surface);
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    box-shadow: 0 8px 20px rgba(16, 24, 40, .05);
}

.ks-section {
    scroll-margin-top: calc(var(--ks-topbar-height) + var(--ks-tabs-height) + var(--ks-spacing-lg));
    padding: var(--ks-spacing-lg);
}

.ks-section-header {
    display: flex;
    align-items: center;
    gap: var(--ks-spacing-md);
    margin-bottom: var(--ks-spacing-md);
}

.ks-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    border: 2px solid rgba(17, 24, 39, .25);
    background: var(--ks-primary);
    box-shadow: 0 6px 14px rgba(17, 24, 39, .12);
}

.ks-section-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: var(--ks-primary);
}

.ks-subtle {
    color: var(--ks-muted);
    font-size: 13px;
}

.ks-divider {
    height: var(--ks-spacing-md);
    border-top: 1px solid rgba(229, 231, 235, .95);
    background: linear-gradient(180deg, rgba(229, 231, 235, .4), transparent);
    margin: var(--ks-spacing-lg) 0;
}

/* ============================================
   Product Description
   ============================================ */
.ks-product-description-content {
    line-height: 1.8;
}

.ks-product-description-content h3 {
    margin: var(--ks-spacing-xl) 0 var(--ks-spacing-md);
    font-size: 16px;
    font-weight: 800;
    color: var(--ks-primary);
}

.ks-product-description-content p {
    margin: 0 0 var(--ks-spacing-lg);
    color: #374151;
    font-size: 15px;
    line-height: 1.8;
}

.ks-product-description-content ul {
    margin: 0 0 var(--ks-spacing-lg);
    padding-right: var(--ks-spacing-xl);
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--ks-spacing-md);
}

.ks-product-description-content li {
    display: flex;
    align-items: flex-start;
    gap: var(--ks-spacing-sm);
}

.ks-product-description-content li > span:first-child {
    color: var(--ks-primary);
    font-weight: 800;
    flex-shrink: 0;
}

.ks-product-description-content li > span:last-child {
    color: #374151;
    line-height: 1.7;
}

/* ============================================
   Specifications
   ============================================ */
.ks-spec-list {
    display: flex;
    flex-direction: column;
    gap: var(--ks-spacing-md);
    padding: 0;
    margin: 0;
    list-style: none;
}

.ks-spec-item {
    border-radius: var(--ks-radius-sm);
    background: #fafbff;
    border: 1px solid rgba(229, 231, 235, .9);
    padding: var(--ks-spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--ks-spacing-xs);
}

.ks-spec-key {
    font-weight: 800;
    color: var(--ks-primary);
    font-size: 14px;
}

.ks-spec-val {
    color: #374151;
    font-weight: 400;
    font-size: 14px;
}

.ks-spec-item.ks-is-extra {
    display: flex;
}

.ks-spec-item.ks-is-extra.ks-hidden {
    display: none;
}

.ks-spec-more {
    margin-top: var(--ks-spacing-md);
    display: flex;
    justify-content: flex-start;
}

.ks-no-specs {
    color: var(--ks-muted);
    font-size: 14px;
}

/* ============================================
   Comments/Reviews
   ============================================ */
.ks-comments-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--ks-spacing-lg);
    align-items: start;
}

.ks-hint-box {
    background: #f8fafc;
    border: 1px solid rgba(229, 231, 235, .9);
    border-radius: var(--ks-radius);
    padding: var(--ks-spacing-md);
}

.ks-empty-state {
    padding: var(--ks-spacing-lg);
    border-radius: var(--ks-radius);
    background: #fff;
    border: 1px dashed rgba(17, 24, 39, .22);
}

.ks-hint-title {
    margin: 0 0 6px;
    font-weight: 900;
    color: var(--ks-primary);
}

.ks-hint-text {
    margin: 0;
    color: var(--ks-muted);
    font-weight: 600;
    font-size: 13px;
}

.ks-reviews-container {
    margin-top: var(--ks-spacing-lg);
}

.ks-review-item {
    background: var(--ks-surface);
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    padding: var(--ks-spacing-md);
    margin-bottom: var(--ks-spacing-md);
}

.ks-review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--ks-spacing-sm);
}

.ks-reviewer-name {
    font-weight: 700;
    color: var(--ks-primary);
    font-size: 14px;
}

.ks-review-date {
    font-size: 12px;
    color: var(--ks-muted);
}

.ks-review-rating {
    margin-bottom: var(--ks-spacing-sm);
}

.ks-star-filled {
    color: #f59e0b;
}

.ks-star-empty {
    color: #d1d5db;
}

.ks-review-content {
    color: #374151;
    font-size: 14px;
    line-height: 1.7;
}

.ks-no-reviews {
    background: var(--ks-surface);
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    padding: var(--ks-spacing-md);
}

.ks-no-reviews p {
    margin: 0;
    color: var(--ks-muted);
    font-weight: 700;
}

/* Add Review Card */
.ks-add-review-card {
    background: var(--ks-surface);
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    padding: var(--ks-spacing-md);
}

.ks-add-review-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.ks-review-icon {
    font-size: 20px;
}

.ks-add-review-header p {
    margin: 0;
    font-weight: 900;
    color: var(--ks-primary);
}

/* Rating Display */
.ks-rating {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ks-spacing-md);
    margin-top: var(--ks-spacing-sm);
}

.ks-score {
    font-size: 44px;
    font-weight: 900;
    letter-spacing: -1px;
    color: var(--ks-primary);
}

.ks-review-count-label {
    font-weight: 800;
}

.ks-stars {
    display: flex;
    gap: 4px;
    align-items: center;
    font-size: 16px;
}

/* Rating Bars */
.ks-bars {
    display: flex;
    flex-direction: column;
    gap: var(--ks-spacing-md);
    margin-top: var(--ks-spacing-sm);
}

.ks-bar {
    display: flex;
    align-items: center;
    gap: var(--ks-spacing-md);
}

.ks-bar-track {
    height: 10px;
    background: rgba(17, 24, 39, .06);
    border: 1px solid rgba(17, 24, 39, .08);
    border-radius: 999px;
    flex: 1;
    position: relative;
    overflow: hidden;
}

.ks-bar-fill {
    position: absolute;
    inset: 0;
    width: 0%;
    background: rgba(245, 158, 11, .85);
    border-radius: 999px;
}

.ks-bar-label {
    width: 18px;
    text-align: center;
    font-weight: 800;
    color: rgba(17, 24, 39, .55);
    font-size: 12px;
}

.ks-review-hint {
    margin: 10px 2px 0;
    font-weight: 700;
}

/* ============================================
   Add Review Button
   ============================================ */
#ks-add-review-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    margin-top: 16px;
    background: linear-gradient(135deg, var(--ks-primary) 0%, #0f172a 100%);
    color: #fff;
    border: none;
    border-radius: var(--ks-radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.15);
    position: relative;
    overflow: hidden;
}

#ks-add-review-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

#ks-add-review-btn:hover::before {
    left: 100%;
}

#ks-add-review-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.25);
    background: linear-gradient(135deg, #0f172a 0%, var(--ks-primary) 100%);
}

#ks-add-review-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.2);
}

#ks-add-review-btn span[aria-hidden="true"] {
    font-size: 18px;
    font-weight: 300;
    line-height: 1;
    transition: transform 0.3s ease;
}

#ks-add-review-btn:hover span[aria-hidden="true"] {
    transform: rotate(90deg) scale(1.1);
}

/* ============================================
   Review Form Wrapper
   ============================================ */
.ks-review-form-wrapper {
    margin-top: var(--ks-spacing-xl);
    padding: var(--ks-spacing-2xl);
    background: var(--ks-surface);
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    box-shadow: 0 4px 16px rgba(16, 24, 40, 0.06);
}

/* Review Form Title */
.ks-review-form-wrapper #reply-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--ks-primary);
    margin-bottom: var(--ks-spacing-xl);
    padding-bottom: var(--ks-spacing-md);
    border-bottom: 2px solid var(--ks-border);
}

.ks-review-form-wrapper #reply-title small {
    display: block;
    margin-top: var(--ks-spacing-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--ks-muted);
}

.ks-review-form-wrapper #reply-title small a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ks-review-form-wrapper #reply-title small a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Form Container */
.ks-review-form-wrapper #review_form {
    margin-top: var(--ks-spacing-lg);
}

.ks-review-form-wrapper .comment-form {
    display: flex;
    flex-direction: column;
    gap: var(--ks-spacing-lg);
}

/* Rating Section */
.ks-review-form-wrapper .wd-review-criteria-wrap {
    background: #f8fafc;
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius-sm);
    padding: var(--ks-spacing-lg);
    margin-bottom: var(--ks-spacing-lg);
}

.ks-review-form-wrapper .comment-form-rating {
    display: flex;
    align-items: center;
    gap: var(--ks-spacing-md);
    margin-bottom: var(--ks-spacing-md);
    padding: var(--ks-spacing-sm) 0;
}

.ks-review-form-wrapper .comment-form-rating:last-child {
    margin-bottom: 0;
}

.ks-review-form-wrapper .comment-form-rating label {
    font-size: 14px;
    font-weight: 700;
    color: var(--ks-primary);
    min-width: 120px;
    margin: 0;
}

.ks-review-form-wrapper .comment-form-rating label .required {
    color: #dc2626;
    margin-right: 4px;
}

/* Star Rating */
.ks-review-form-wrapper .stars {
    display: flex;
    gap: 2px;
    align-items: center;
    direction: ltr;
    unicode-bidi: bidi-override;
}

.ks-review-form-wrapper .stars a {
    color: #d1d5db;
    font-size: 0 !important;
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1;
    display: inline-block;
    width: 24px;
    height: 24px;
    text-align: center;
    position: relative;
    cursor: pointer;
    text-indent: -9999px;
    overflow: hidden;
    /* Hide all text content */
    color: transparent !important;
}

/* Display star character only */
.ks-review-form-wrapper .stars a::before {
    content: "★";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    line-height: 1;
    text-indent: 0;
    display: block;
    /* Default star color */
    color: #d1d5db;
    transition: color 0.2s ease;
}

/* Hide text content in stars span */
.ks-review-form-wrapper .stars span {
    display: flex;
    gap: 2px;
    align-items: center;
}

.ks-review-form-wrapper .stars span a {
    /* Ensure text is completely hidden */
    font-size: 0 !important;
    line-height: 0 !important;
    text-indent: -9999px !important;
    overflow: hidden !important;
}

/* Hover effect - fill stars up to hovered star */
.ks-review-form-wrapper .stars:hover a::before {
    color: #f59e0b;
}

.ks-review-form-wrapper .stars a:hover ~ a::before {
    color: #d1d5db;
}

/* Selected state - When stars container has 'selected' class, fill ALL stars */
.ks-review-form-wrapper .stars.selected a::before {
    color: #f59e0b !important;
}

/* Reset stars AFTER the active one (if any) */
.ks-review-form-wrapper .stars.selected a.active ~ a::before,
.ks-review-form-wrapper .stars.selected a[aria-checked="true"] ~ a::before {
    color: #d1d5db !important;
}

/* Also handle when stars don't have selected class but have active star */
.ks-review-form-wrapper .stars:not(.selected) a.active::before,
.ks-review-form-wrapper .stars:not(.selected) a[aria-checked="true"]::before {
    color: #f59e0b;
}

.ks-review-form-wrapper .stars:not(.selected) a.active ~ a::before,
.ks-review-form-wrapper .stars:not(.selected) a[aria-checked="true"] ~ a::before {
    color: #d1d5db;
}

/* For criteria stars (different structure) */
.ks-review-form-wrapper .wd-review-criteria .stars {
    display: flex;
    gap: 2px;
    align-items: center;
    direction: ltr;
    unicode-bidi: bidi-override;
}

.ks-review-form-wrapper .wd-review-criteria .stars a {
    color: #d1d5db;
    font-size: 0 !important;
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1;
    display: inline-block;
    width: 24px;
    height: 24px;
    text-align: center;
    position: relative;
    cursor: pointer;
    text-indent: -9999px;
    overflow: hidden;
    /* Hide all text content */
    color: transparent !important;
}

.ks-review-form-wrapper .wd-review-criteria .stars a::before {
    content: "★";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    line-height: 1;
    text-indent: 0;
    display: block;
    /* Default star color */
    color: #d1d5db;
    transition: color 0.2s ease;
}

/* Hide text content in criteria stars span */
.ks-review-form-wrapper .wd-review-criteria .stars span {
    display: flex;
    gap: 2px;
    align-items: center;
}

.ks-review-form-wrapper .wd-review-criteria .stars span a {
    /* Ensure text is completely hidden */
    font-size: 0 !important;
    line-height: 0 !important;
    text-indent: -9999px !important;
    overflow: hidden !important;
}

.ks-review-form-wrapper .wd-review-criteria .stars:hover a::before {
    color: #f59e0b;
}

.ks-review-form-wrapper .wd-review-criteria .stars a:hover ~ a::before {
    color: #d1d5db;
}

/* Selected state for criteria stars - fill all stars up to active one */
.ks-review-form-wrapper .wd-review-criteria .stars.selected a::before {
    color: #f59e0b;
}

/* Reset stars after the active one */
.ks-review-form-wrapper .wd-review-criteria .stars.selected a.active ~ a::before {
    color: #d1d5db;
}

/* Also handle when stars don't have selected class but have active star */
.ks-review-form-wrapper .wd-review-criteria .stars a.active::before {
    color: #f59e0b;
}

.ks-review-form-wrapper .wd-review-criteria .stars a.active ~ a::before {
    color: #d1d5db;
}

/* Review Criteria */
.ks-review-form-wrapper .wd-review-criteria {
    display: flex;
    align-items: center;
    gap: var(--ks-spacing-md);
    margin-bottom: var(--ks-spacing-md);
    padding: var(--ks-spacing-sm) 0;
}

.ks-review-form-wrapper .wd-review-criteria:last-child {
    margin-bottom: 0;
}

.ks-review-form-wrapper .wd-review-criteria label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    min-width: 120px;
    margin: 0;
}

/* مخفی کردن select box های criteria - روش اصولی قالب Woodmart */
.ks-review-form-wrapper .wd-review-criteria select,
.ks-review-form-wrapper .wd-review-criteria-wrap select {
    display: none !important;
}

/* Comment Textarea */
.ks-review-form-wrapper .comment-form-comment {
    margin: 0;
}

.ks-review-form-wrapper .comment-form-comment label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--ks-primary);
    margin-bottom: var(--ks-spacing-sm);
}

.ks-review-form-wrapper .comment-form-comment label .required {
    color: #dc2626;
    margin-right: 4px;
}

.ks-review-form-wrapper .comment-form-comment textarea {
    width: 100%;
    padding: var(--ks-spacing-md);
    border: 2px solid var(--ks-border);
    border-radius: var(--ks-radius-sm);
    background: var(--ks-surface);
    color: var(--ks-text);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.2s ease;
    min-height: 120px;
}

.ks-review-form-wrapper .comment-form-comment textarea:focus {
    outline: none;
    border-color: var(--ks-primary);
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1);
}

/* Pros and Cons Fields - طراحی مینیمال */
.ks-review-form-wrapper .comment-form-pros,
.ks-review-form-wrapper .comment-form-cons {
    margin: 0;
    position: relative;
    display: inline-block;
    width: calc(50% - var(--ks-spacing-sm));
    vertical-align: top;
}

.ks-review-form-wrapper .comment-form-pros {
    margin-left: var(--ks-spacing-sm);
}

/* Label */
.ks-review-form-wrapper .comment-form-pros label,
.ks-review-form-wrapper .comment-form-cons label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: var(--ks-spacing-sm);
    color: var(--ks-text);
}

.ks-review-form-wrapper .comment-form-pros label::before,
.ks-review-form-wrapper .comment-form-cons label::before {
    display: none;
}

/* Input Fields */
.ks-review-form-wrapper .comment-form-pros input,
.ks-review-form-wrapper .comment-form-cons input {
    width: 100%;
    padding: var(--ks-spacing-md);
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius-sm);
    background: var(--ks-surface);
    color: var(--ks-text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.ks-review-form-wrapper .comment-form-pros input::placeholder,
.ks-review-form-wrapper .comment-form-cons input::placeholder {
    color: var(--ks-muted);
}

.ks-review-form-wrapper .comment-form-pros input:focus,
.ks-review-form-wrapper .comment-form-cons input:focus {
    outline: none;
    border-color: var(--ks-primary);
}

/* Image Upload Section */
.ks-review-form-wrapper .comment-form-images {
    margin: 0;
}

.ks-review-form-wrapper .wd-add-img-btn-wrapper {
    border: 2px dashed var(--ks-border);
    border-radius: var(--ks-radius-sm);
    padding: var(--ks-spacing-lg);
    text-align: center;
    background: #f8fafc;
    transition: all 0.2s ease;
    cursor: pointer;
}

.ks-review-form-wrapper .wd-add-img-btn-wrapper:hover {
    border-color: var(--ks-primary);
    background: rgba(17, 24, 39, 0.02);
}

.ks-review-form-wrapper .wd-add-img-btn-wrapper label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ks-primary);
    margin-bottom: var(--ks-spacing-sm);
    cursor: pointer;
}

.ks-review-form-wrapper .wd-add-img-btn-wrapper input[type="file"] {
    display: none;
}

.ks-review-form-wrapper .wd-add-img-msg {
    font-size: 11px;
    color: var(--ks-muted);
    margin-top: var(--ks-spacing-xs);
}

/* Submit Button */
.ks-review-form-wrapper .form-submit {
    margin: var(--ks-spacing-md) 0 0;
    padding: 0;
}

.ks-review-form-wrapper .form-submit input[type="submit"] {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--ks-primary) 0%, #0f172a 100%);
    color: #fff;
    border: none;
    border-radius: var(--ks-radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.15);
}

.ks-review-form-wrapper .form-submit input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.25);
    background: linear-gradient(135deg, #0f172a 0%, var(--ks-primary) 100%);
}

.ks-review-form-wrapper .form-submit input[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.2);
}

/* ============================================
   Compact Review Form Styles
   ============================================ */
/* Hide or compact duplicate rating summary */
.ks-review-form-wrapper .wd-rating-summary-wrap {
    display: none !important;
}

.ks-review-form-wrapper .woocommerce-Reviews-title {
    display: none !important;
}

.ks-review-form-wrapper .wd-reviews-heading {
    display: none !important;
}

.ks-review-form-wrapper .wd-reviews-content {
    display: none !important;
}

.ks-review-form-wrapper #comments {
    display: none !important;
}

/* Compact form wrapper */
.ks-review-form-wrapper {
    padding: var(--ks-spacing-lg) !important;
    margin-top: var(--ks-spacing-lg) !important;
}

/* Compact title */
.ks-review-form-wrapper #reply-title {
    font-size: 16px !important;
    margin-bottom: var(--ks-spacing-md) !important;
    padding-bottom: var(--ks-spacing-sm) !important;
    border-bottom: 1px solid var(--ks-border) !important;
}

.ks-review-form-wrapper #reply-title small {
    margin-top: var(--ks-spacing-xs) !important;
    font-size: 12px !important;
}

/* Compact form container */
.ks-review-form-wrapper #review_form {
    margin-top: var(--ks-spacing-md) !important;
}

.ks-review-form-wrapper .comment-form {
    gap: var(--ks-spacing-md) !important;
}

/* Compact rating section */
.ks-review-form-wrapper .wd-review-criteria-wrap {
    padding: var(--ks-spacing-md) !important;
    margin-bottom: var(--ks-spacing-md) !important;
}

.ks-review-form-wrapper .comment-form-rating {
    margin-bottom: var(--ks-spacing-sm) !important;
    padding: var(--ks-spacing-xs) 0 !important;
    gap: var(--ks-spacing-sm) !important;
}

.ks-review-form-wrapper .wd-review-criteria {
    margin-bottom: var(--ks-spacing-sm) !important;
    padding: var(--ks-spacing-xs) 0 !important;
    gap: var(--ks-spacing-sm) !important;
}

.ks-review-form-wrapper .comment-form-rating label,
.ks-review-form-wrapper .wd-review-criteria label {
    min-width: 100px !important;
    font-size: 13px !important;
}

/* Compact stars */
.ks-review-form-wrapper .stars a::before {
    font-size: 18px !important;
}

.ks-review-form-wrapper .stars a {
    width: 22px !important;
    height: 22px !important;
}

.ks-review-form-wrapper .wd-review-criteria .stars a::before {
    font-size: 18px !important;
}

.ks-review-form-wrapper .wd-review-criteria .stars a {
    width: 22px !important;
    height: 22px !important;
}

/* Compact textarea */
.ks-review-form-wrapper .comment-form-comment textarea {
    min-height: 100px !important;
    padding: var(--ks-spacing-sm) var(--ks-spacing-md) !important;
}

.ks-review-form-wrapper .comment-form-comment label {
    margin-bottom: var(--ks-spacing-xs) !important;
    font-size: 13px !important;
}

/* Compact pros/cons */
.ks-review-form-wrapper .comment-form-pros,
.ks-review-form-wrapper .comment-form-cons {
    margin-bottom: var(--ks-spacing-md);
}

/* Compact image upload */
.ks-review-form-wrapper .wd-add-img-btn-wrapper {
    padding: var(--ks-spacing-md) !important;
}

.ks-review-form-wrapper .wd-add-img-btn-wrapper label {
    font-size: 12px !important;
    margin-bottom: var(--ks-spacing-xs) !important;
}

.ks-review-form-wrapper .wd-add-img-msg {
    font-size: 10px !important;
    margin-top: var(--ks-spacing-xs) !important;
}

/* Compact submit button */
.ks-review-form-wrapper .form-submit {
    margin: var(--ks-spacing-sm) 0 0 !important;
}

.ks-review-form-wrapper .form-submit input[type="submit"] {
    padding: 12px 20px !important;
    font-size: 13px !important;
}


/* Responsive */
@media (max-width: 768px) {
    .ks-review-form-wrapper {
        padding: var(--ks-spacing-md) !important;
    }
    
    .ks-review-form-wrapper .comment-form-rating,
    .ks-review-form-wrapper .wd-review-criteria {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--ks-spacing-xs);
    }
    
    .ks-review-form-wrapper .comment-form-rating label,
    .ks-review-form-wrapper .wd-review-criteria label {
        min-width: auto !important;
    }
    
    .ks-review-form-wrapper .comment-form-pros,
    .ks-review-form-wrapper .comment-form-cons {
        width: 100%;
        margin-left: 0;
    }
}

/* ============================================
   Related Products
   ============================================ */
.ks-related-products {
    padding: var(--ks-spacing-3xl) 0;
    background: var(--ks-surface);
    margin-top: var(--ks-spacing-3xl);
}

/* ============================================
   Responsive Styles
   ============================================ */
@media (min-width: 1536px) {
    .ks-product-main-section {
        flex: 1 1 0;
        min-width: 0;
        max-width: 1600px;
    }
    
    .ks-product-details {
        padding: var(--ks-spacing-2xl) var(--ks-spacing-2xl) var(--ks-spacing-3xl) var(--ks-spacing-2xl);
    }
    
    .ks-product-gallery-section {
        padding: var(--ks-spacing-2xl);
    }
    
    .ks-product-purchase {
        flex: 0 0 384px;
        min-width: 384px;
    }
    
    .ks-content-main {
        flex: 1 1 0;
        min-width: 0;
        max-width: 1600px;
    }
    
    .ks-content-purchase {
        flex: 0 0 384px;
        min-width: 384px;
    }
}

@media (min-width: 1200px) {
    .ks-product-main-section {
        min-width: 742px;
    }
    
    .ks-product-details {
        padding: var(--ks-spacing-2xl) var(--ks-spacing-xl) var(--ks-spacing-3xl) var(--ks-spacing-2xl);
    }
    
    .ks-product-gallery-section {
        padding: var(--ks-spacing-2xl) var(--ks-spacing-2xl) var(--ks-spacing-2xl) var(--ks-spacing-xl);
    }
    
    .ks-product-purchase {
        flex: 0 0 392px;
        min-width: 392px;
    }
    
    .ks-content-main {
        min-width: 742px;
    }
    
    .ks-content-purchase {
        flex: 0 0 392px;
        min-width: 392px;
    }
}

@media (max-width: 1200px) {
    .ks-container {
        max-width: 100%;
        padding: 0 var(--ks-spacing-lg);
    }
}

@media (max-width: 980px) {
    .ks-container {
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
    }
    
    .ks-product-header {
        flex-direction: column;
        gap: var(--ks-spacing-lg);
        width: 100%;
        overflow: visible;
    }
    
    .ks-product-main-section {
        display: flex;
        flex-direction: column;
        min-width: 0;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    /* موبایل: گالری بالاترین المان (قبل از عنوان و ویژگی‌های متنی) — دسکتاپ بدون تغییر */
    .ks-product-gallery-section {
        order: -1;
    }

    .ks-product-details {
        order: 0;
    }
    
    .ks-product-details {
        flex: 1 1 100%;
        width: 100%;
        border-left: none;
        border-bottom: 1px solid var(--ks-border);
        padding: var(--ks-spacing-lg);
        padding-bottom: var(--ks-spacing-2xl);
    }
    
    .ks-product-gallery-section {
        flex: 1 1 100%;
        width: 100%;
        padding: var(--ks-spacing-lg);
        border-bottom: none;
    }
    
    .ks-product-purchase {
        flex: 1 1 100%;
        min-width: 0;
        width: 100%;
        position: static;
    }
    
    .ks-content-section {
        flex-direction: column;
        gap: var(--ks-spacing-lg);
    }
    
    .ks-content-main {
        flex: 1 1 100%;
        min-width: 0;
        width: 100%;
    }
    
    .ks-content-purchase {
        flex: 1 1 100%;
        min-width: 0;
        width: 100%;
        position: static;
    }
    
    .ks-comments-layout {
        grid-template-columns: 1fr;
    }
    
    .ks-gallery-zoom {
        display: none;
    }
    
    .ks-gallery-main {
        cursor: default;
    }

    /* ویژگی‌های کلیدی: چیدمان افقی در موبایل/تبلت */
    .ks-quick-info-items {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: stretch;
        gap: var(--ks-spacing-sm) var(--ks-spacing-md);
        grid-template-columns: none;
    }

    .ks-quick-info-item {
        flex: 1 1 calc(50% - var(--ks-spacing-sm));
        flex-direction: row;
        align-items: center;
        text-align: start;
        gap: var(--ks-spacing-sm);
        min-width: 0;
    }

    .ks-quick-info-icon {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }

    .ks-quick-info-icon svg {
        width: 20px;
        height: 20px;
    }

    .ks-quick-info-content {
        align-items: flex-start;
        min-width: 0;
    }

    .ks-quick-info-content strong,
    .ks-quick-info-content span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    :root {
        --ks-spacing-xl: 20px;
        --ks-spacing-2xl: 24px;
    }
    
    /* اطمینان از نمایش section در موبایل */
    .ks-product-main-section {
        display: flex !important;
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        margin: 0;
        overflow: visible;
    }
    
    .ks-product-details {
        width: 100%;
        padding: var(--ks-spacing-md) var(--ks-spacing-lg);
    }
    
    .ks-product-gallery-section {
        width: 100%;
        padding: var(--ks-spacing-md) var(--ks-spacing-lg);
        order: -1;
    }

    .ks-product-details {
        order: 0;
    }
    
    /* Responsive Pros/Cons */
    .ks-review-form-wrapper .comment-form-pros,
    .ks-review-form-wrapper .comment-form-cons {
        width: 100%;
        margin-left: 0;
        margin-bottom: var(--ks-spacing-md);
    }
    
    .ks-review-form-wrapper .comment-form-pros label,
    .ks-review-form-wrapper .comment-form-cons label {
        font-size: 13px;
    }
    
    .ks-review-form-wrapper .comment-form-pros input,
    .ks-review-form-wrapper .comment-form-cons input {
        font-size: 14px;
        padding: var(--ks-spacing-md);
    }
}

@media (max-width: 640px) {
    .ks-product-title-main {
        font-size: clamp(1.0625rem, 4.2vw, 1.25rem);
    }
    
    .ks-product-main-section {
        display: flex !important;
        flex-direction: column;
        border-radius: var(--ks-radius-sm);
        margin: 0;
        width: 100%;
        max-width: 100%;
        overflow: visible;
    }
    
    .ks-product-details {
        padding: var(--ks-spacing-md);
        width: 100%;
    }
    
    .ks-product-gallery-section {
        padding: var(--ks-spacing-md);
        width: 100%;
    }
    
    .ks-product-gallery-section {
        order: -1;
    }

    /* اطمینان از نمایش تمام عناصر داخلی (بدون شکستن flex order) */
    .ks-product-details,
    .ks-product-gallery-section {
        visibility: visible;
        opacity: 1;
    }
    
    .ks-spec-item.ks-is-extra {
        display: none;
    }
    
    .ks-spec-item.ks-is-extra.ks-is-open {
        display: flex;
    }
}

@media (max-width: 480px) {
    .ks-product-main-section {
        display: flex !important;
        flex-direction: column;
        width: 100% !important;
        margin: 0 !important;
        padding: 0;
    }
    
    .ks-product-details,
    .ks-product-gallery-section {
        width: 100% !important;
        padding: var(--ks-spacing-md) !important;
    }

    .ks-product-gallery-section {
        order: -1;
    }
    
    .ks-quick-info-items {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        justify-content: flex-start;
        gap: var(--ks-spacing-md);
        padding-bottom: 2px;
    }

    .ks-quick-info-items::-webkit-scrollbar {
        display: none;
    }

    .ks-quick-info-item {
        flex: 0 0 auto;
        min-width: 148px;
        max-width: 168px;
    }
}

/* ============================================
   Hide Default WooCommerce Elements
   ============================================ */
.ks-custom-product .woocommerce-product-rating,
.ks-custom-product .product_meta {
    display: none !important;
}

/* Hide default WooCommerce breadcrumb (outside our custom container) */
body.kalashahr-custom-pdp .woocommerce-breadcrumb {
    display: none !important;
}

/* Show breadcrumb inside our custom container */
.ks-custom-product .ks-breadcrumb .woocommerce-breadcrumb,
.ks-custom-product .ks-breadcrumb .wd-breadcrumbs {
    display: flex !important;
}

/* Style WooCommerce quantity input */
.ks-add-to-cart-wrapper .quantity {
    display: inline-flex;
    align-items: center;
    background: var(--ks-surface);
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius-sm);
    overflow: hidden;
    margin-left: var(--ks-spacing-sm);
}

.ks-add-to-cart-wrapper .quantity input {
    width: 50px;
    text-align: center;
    border: none;
    padding: 8px;
    font-size: 14px;
    font-weight: 600;
}

.ks-add-to-cart-wrapper .quantity input:focus {
    outline: none;
}

/* Variable product price display */
.ks-add-to-cart-wrapper .woocommerce-variation-price {
    display: none !important;
}

.ks-add-to-cart-wrapper .woocommerce-variation-availability {
    display: none !important;
}

/* ============================================
   WOOSB product bundles – compact rows & qty stepper
   (qty buttons inherit large Woodmart .btn rules without these overrides)
   ============================================ */
body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-wrap {
    margin-top: var(--ks-spacing-sm);
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-products {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 6px;
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-product {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 6px 8px;
    padding: 8px;
    background: var(--ks-soft);
    border: 1px solid var(--ks-border);
    border-radius: 8px;
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-thumb {
    grid-row: 1 / -1;
    align-self: center;
    margin: 0 !important;
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-thumb-ori {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-thumb-ori img {
    width: 40px !important;
    height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    border: 1px solid rgba(229, 231, 235, .9);
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-title {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    min-width: 0;
    margin: 0 !important;
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-title-inner {
    font-size: 12px;
    font-weight: 700;
    color: var(--ks-text);
    line-height: 1.35;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

/* وضعیت موجودی WOOSB — تم Woodmart padding بزرگ به «ناموجود» می‌دهد */
body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-availability {
    margin: 0 !important;
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-availability p.stock {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-availability p.stock span {
    display: inline-block !important;
    padding: 2px 6px !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
    border-radius: 4px !important;
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-availability p.stock.wd-style-bordered span::before {
    width: 4px !important;
    height: 4px !important;
    margin-inline-end: 4px !important;
    vertical-align: middle !important;
}

/* Compact stepper only inside bundle rows */
body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-quantity {
    margin: 0 !important;
    justify-self: center;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-quantity .quantity {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    min-height: 0 !important;
    height: 28px !important;
    border-radius: 6px !important;
    border: 1px solid var(--ks-border) !important;
    background: #fff !important;
    box-shadow: none !important;
}

/* حالت ناموجود: فقط input غیرفعال بدون wrapper .quantity */
body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-quantity > input.input-text.qty[disabled],
body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-quantity > input.qty[disabled] {
    box-sizing: border-box;
    width: 30px !important;
    min-width: 30px !important;
    height: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid var(--ks-border) !important;
    border-radius: 6px !important;
    background: #f3f4f6 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    text-align: center !important;
    color: var(--ks-muted) !important;
    opacity: 1 !important;
    -moz-appearance: textfield;
    appearance: textfield;
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-quantity > input.input-text.qty[disabled]::-webkit-outer-spin-button,
body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-quantity > input.input-text.qty[disabled]::-webkit-inner-spin-button,
body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-quantity > input.qty[disabled]::-webkit-outer-spin-button,
body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-quantity > input.qty[disabled]::-webkit-inner-spin-button {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-quantity .quantity .minus,
body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-quantity .quantity .plus {
    flex: 0 0 24px !important;
    width: 24px !important;
    min-width: 24px !important;
    height: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    color: var(--ks-primary) !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-quantity .quantity .minus:hover,
body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-quantity .quantity .plus:hover {
    background: rgba(17, 24, 39, .06) !important;
    color: var(--ks-primary) !important;
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-quantity .quantity input.qty,
body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-quantity .quantity input.woosb-qty {
    flex: 0 0 28px !important;
    width: 28px !important;
    min-width: 28px !important;
    height: 24px !important;
    margin: 0 !important;
    padding: 0 1px !important;
    border: none !important;
    border-radius: 0 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-price {
    margin: 0 !important;
    justify-self: end;
    align-self: center;
    text-align: end;
    min-width: 0;
}

@media (max-width: 479px) {
    body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-product {
        grid-template-columns: 36px minmax(0, 1fr) auto;
        grid-template-rows: auto auto;
    }

    body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-thumb {
        grid-column: 1;
        grid-row: 1 / -1;
        align-self: center;
    }

    body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-title {
        grid-column: 2 / -1;
        grid-row: 1;
    }

    body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-quantity {
        grid-column: 2;
        grid-row: 2;
        justify-self: start;
    }

    body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-price {
        grid-column: 3;
        grid-row: 2;
        justify-self: end;
    }
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-price-ori {
    display: flex;
    flex-direction: column;
    align-items: end;
    gap: 0;
    font-size: 11px;
    line-height: 1.15;
    white-space: nowrap;
}

@media (max-width: 479px) {
    body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-price-ori {
        align-items: start;
    }
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-price-ori del {
    opacity: 0.55;
    font-size: 10px;
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-price-ori ins {
    text-decoration: none;
    font-weight: 800;
    color: var(--ks-primary);
    font-size: 12px;
}

/* جلوگیری از شکستن عدد طولانی به چند خط */
body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-price-ori .amount {
    white-space: nowrap;
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-total {
    margin-top: var(--ks-spacing-sm);
    padding-top: var(--ks-spacing-sm);
    border-top: 1px dashed var(--ks-border);
    font-size: 13px;
    font-weight: 600;
    color: var(--ks-muted);
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper .woosb-total .amount {
    font-weight: 800;
    color: var(--ks-text);
    font-size: 15px;
}

/* Bundle parent form: stacked qty + CTA, sane button sizes (only when WOOSB present) */
body.kalashahr-custom-pdp .ks-add-to-cart-wrapper:has(.woosb-wrap) form.cart {
    display: flex;
    flex-direction: column;
    gap: var(--ks-spacing-sm);
    margin-top: var(--ks-spacing-md);
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper:has(.woosb-wrap) form.cart .quantity {
    align-self: stretch;
    justify-content: center;
    margin: 0 !important;
    max-width: 160px;
    margin-inline: auto !important;
    height: 40px;
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper:has(.woosb-wrap) form.cart .quantity .minus,
body.kalashahr-custom-pdp .ks-add-to-cart-wrapper:has(.woosb-wrap) form.cart .quantity .plus {
    flex: 0 0 36px;
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    line-height: 1;
    font-weight: 700;
    background: transparent;
    color: var(--ks-primary);
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper:has(.woosb-wrap) form.cart .quantity .minus:hover,
body.kalashahr-custom-pdp .ks-add-to-cart-wrapper:has(.woosb-wrap) form.cart .quantity .plus:hover {
    background: rgba(17, 24, 39, .06);
}

body.kalashahr-custom-pdp .ks-add-to-cart-wrapper:has(.woosb-wrap) form.cart .quantity input.qty {
    width: 44px;
    padding: 6px 4px;
    font-size: 15px;
}

/* ============================================
   Breadcrumb Styles
   ============================================ */
.ks-custom-product .ks-breadcrumb {
    padding: var(--ks-spacing-md) 0;
    margin-bottom: var(--ks-spacing-md);
    border-bottom: 1px solid var(--ks-border);
}

.ks-custom-product .ks-breadcrumb .wd-breadcrumbs,
.ks-custom-product .ks-breadcrumb .woocommerce-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--ks-spacing-xs);
    font-size: 14px;
    color: var(--ks-text-secondary);
    direction: rtl;
}

.ks-custom-product .ks-breadcrumb a {
    color: var(--ks-text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.ks-custom-product .ks-breadcrumb a:hover {
    color: var(--ks-primary);
}

.ks-custom-product .ks-breadcrumb .wd-delimiter,
.ks-custom-product .ks-breadcrumb .woocommerce-breadcrumb .delimiter {
    margin: 0 var(--ks-spacing-xs);
    color: var(--ks-text-tertiary);
}

.ks-custom-product .ks-breadcrumb .wd-last,
.ks-custom-product .ks-breadcrumb .woocommerce-breadcrumb .breadcrumb-last {
    color: var(--ks-text);
    font-weight: 500;
}

/* ============================================
   Product Page Layout Background
   ============================================ */
body.kalashahr-custom-pdp .wd-content-layout {
    padding-block: 20px;
    background: #F6F7FB !important;
}
