/*
 * ============================================
 * SINGLE PRODUCT - FINAL (مع دعم الإضافات)
 * ============================================
 */

.product-page-container {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 16px;
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    direction: rtl;
}

.product-main-content {
    display: flex;
    flex-direction: column;
}

/* === معرض الصور === */
.product-gallery-section .woocommerce-product-gallery {
    border: none;
    box-shadow: none;
}
.product-gallery-section .woocommerce-product-gallery__image {
    padding-bottom: 100%;
}
.product-gallery-section .woocommerce-product-gallery__image img {
    object-fit: contain;
    padding: 20px;
}
.product-gallery-section .flex-control-nav {
    display: none;
}
.product-gallery-section .woocommerce-product-gallery__trigger {
    display: none !important;
}

/* === تفاصيل المنتج === */
.product-details-wrapper {
    margin-top: 24px;
}

.product-details-wrapper .product_title {
    font-size: 28px;
    font-weight: 600;
    color: #121212;
    line-height: 1.3;
    margin: 0 0 8px 0;
}

.product-details-wrapper .price {
    font-size: 18px;
    font-weight: 400;
    color: #333;
    margin-bottom: 16px;
}

.separator {
    height: 1px;
    background-color: #f0f0f0;
    margin: 20px 0;
}

/* === خيارات الحجم - دعم كل الإضافات === */
.variations_form .variations {
    margin-bottom: 20px;
    border: 0;
}

.variations_form .variations tbody {
    display: block;
}

.variations_form .variations tr {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.variations_form .variations .label label {
    font-size: 16px;
    font-weight: 600;
    color: #000;
    margin: 0 0 8px 0;
}

/* إخفاء الـ select الأصلي */
.variations_form .variations select {
    display: none !important;
}

/* === تنسيق مربعات الإضافات الشهيرة === */

/* Variation Swatches for WooCommerce */
.tawcvs-swatches,
.variations .value .variable-items-wrapper,
.swatch-wrapper,
.vi-wpvs-variation-wrap,
.wvs-attribute-options {
    display: flex !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    margin-top: 8px !important;
}

/* المربعات - تنسيق موحد لكل الإضافات */
.tawcvs-swatches .swatch,
.variable-items-wrapper .variable-item,
.swatch-wrapper .swatch,
.vi-wpvs-variation-wrap .vi-wpvs-option-wrap,
.wvs-attribute-options .variable-item {
    min-width: 70px !important;
    padding: 10px 18px !important;
    background: #fff !important;
    border: 1.5px solid #d0d0d0 !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #333 !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    user-select: none !important;
    box-shadow: none !important;
    line-height: 1.4 !important;
}

/* Hover */
.tawcvs-swatches .swatch:hover,
.variable-items-wrapper .variable-item:hover,
.swatch-wrapper .swatch:hover,
.vi-wpvs-variation-wrap .vi-wpvs-option-wrap:hover,
.wvs-attribute-options .variable-item:hover {
    border-color: #666 !important;
    color: #000 !important;
    background: #fff !important;
}

/* Selected/Active */
.tawcvs-swatches .swatch.selected,
.tawcvs-swatches .swatch.active,
.variable-items-wrapper .variable-item.selected,
.swatch-wrapper .swatch.selected,
.vi-wpvs-variation-wrap .vi-wpvs-option-wrap.vi-wpvs-option-selected,
.wvs-attribute-options .variable-item.selected {
    background: #000 !important;
    color: #fff !important;
    border-color: #000 !important;
}

/* Disabled */
.tawcvs-swatches .swatch.disabled,
.variable-items-wrapper .variable-item.disabled,
.swatch-wrapper .swatch.disabled,
.vi-wpvs-variation-wrap .vi-wpvs-option-wrap.vi-wpvs-option-disabled,
.wvs-attribute-options .variable-item.disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* إخفاء زر Reset */
.reset_variations {
    display: none !important;
}

/* === الكمية - محاذاة مثالية === */
.single_variation_wrap {
    margin-top: 20px;
}

.woocommerce-variation-add-to-cart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quantity-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.quantity-label {
    font-size: 16px;
    font-weight: 600;
    color: #000;
}

/* مربع الكمية */
.quantity {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    height: 48px;
    padding: 0;
    gap: 0;
    overflow: hidden;
    width: 140px; /* Fixed width for better control */
}

.quantity .minus,
.quantity .plus {
    width: 40px;
    height: 100%;
    background: #f9f9f9;
    border: none;
    color: #333;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.quantity .minus:hover,
.quantity .plus:hover {
    background: #eee;
    color: #000;
}

/* الرقم - محاذاة 100% */
.quantity .qty {
    flex: 1;
    height: 100%;
    text-align: center;
    border: none;
    border-left: 1px solid #e1e1e1;
    border-right: 1px solid #e1e1e1;
    background: #fff;
    color: #000 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 48px !important;
    box-shadow: none !important;
    outline: none !important;
    -moz-appearance: textfield !important;
    -webkit-appearance: none !important;
}

.quantity .qty:focus {
    outline: none !important;
    box-shadow: none !important;
}

.quantity input[type="number"]::-webkit-outer-spin-button,
.quantity input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
    display: none !important;
}

/* === زر إضافة للسلة === */
.single_add_to_cart_button {
    width: 100%;
    height: 52px;
    background: #000 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    transition: background 0.2s ease !important;
    cursor: pointer;
}

.single_add_to_cart_button:hover {
    background: #333 !important;
}

/* === زر اشتر الآن === */
.buy-now-section {
    margin-top: 12px;
}
.buy-now-button {
    width: 100%;
    height: 52px;
    background: #fff;
    color: #000;
    border: 1.5px solid #000;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
}
.buy-now-button:hover {
    background: #f5f5f5;
}

/* === شريط مزايا الثقة === */
.trust-badge-bar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #eee;
}
.trust-badge-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}
.trust-badge-item i {
    font-size: 18px;
    color: #b38e5d;
    width: 24px;
    text-align: center;
}

/* === دليل الأحجام === */
.size-guide-section {
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
}

.size-guide-image {
    width: 100%;
    height: auto;
    display: block;
}

/* === وصف المنتج === */
.product-description-section p,
.product-description-section ul {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
}

/* === منتجات مقترحة === */
.related-products-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #f0f0f0;
}

.related-products-section h2 {
    font-size: 24px;
    font-weight: 600;
    color: #000;
    margin-bottom: 24px;
    text-align: right;
}

.related-products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.related-product-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    text-decoration: none;
}

.related-product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.related-product-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: #fff;
}

.related-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
}

.related-product-info {
    padding: 12px;
    text-align: right;
}

.related-product-title {
    font-size: 14px;
    font-weight: 500;
    color: #000;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-product-price {
    font-size: 15px;
    font-weight: 600;
    color: #000;
}

/* === Desktop === */
@media (min-width: 992px) {
    .product-page-container {
        max-width: 1280px !important;
        padding: 40px 32px !important;
    }

    .product-main-content {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 80px !important;
    }

    .product-gallery-section {
        position: sticky !important;
        top: 40px !important;
    }

    .trust-badge-bar {
        flex-direction: row !important;
        justify-content: space-between !important;
        background: #f9f9f9;
        padding: 16px 24px;
        border-radius: 12px;
    }

    .related-products-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 24px !important;
    }
}
