/* ========================================================
   Ringo Single Product Layout & Advanced Styling (Fixed)
======================================================== */
.ringo-single-page { padding: 30px 0 60px; direction: rtl; }

/* Breadcrumb Styling (مسیر راهنما) */
.woocommerce-breadcrumb {
    background: #fff;
    padding: 15px 25px !important;
    border-radius: 12px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}
.woocommerce-breadcrumb a { color: #002554; text-decoration: none; font-weight: bold; transition: color 0.2s; }
.woocommerce-breadcrumb a:hover { color: #f97316; }
.woocommerce-breadcrumb .bd-sep { color: #cbd5e1; font-weight: normal; margin: 0 4px; }

/* Top Section (Gallery & Summary) */
.ringo-single-top {
    display: flex; flex-wrap: wrap; background: #fff; border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03); border: 1px solid #e5e7eb;
    padding: 30px; gap: 40px; margin-bottom: 40px;
}

/* Gallery (Right) */
.rs-gallery { width: 35%; position: relative; text-align: center; display: flex; align-items: center; justify-content: center; }
.rs-gallery img { max-width: 100%; height: auto; object-fit: contain; }
.rs-gallery.is-outofstock img { filter: grayscale(100%) opacity(0.6); }
.rs-outofstock-badge {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: rgba(0, 37, 84, 0.85); color: #fff; padding: 10px 25px;
    border-radius: 50px; font-size: 18px; font-weight: 900; backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.2); z-index: 3; pointer-events: none;
}

/* Summary (Left) */
.rs-summary { width: calc(65% - 40px); display: flex; flex-direction: column; }

/* اصلاح تراز عنوان و لوگو */
.rs-header-wrap { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; border-bottom: 1px dashed #e2e8f0; padding-bottom: 20px; flex-wrap: wrap; gap: 15px; }
.rs-title-area { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex: 1; }
.rs-title-area h1 { font-size: 22px; font-weight: 900; color: #002554; margin: 0; line-height: 1.6; }
.rs-title-suffix { font-size: 14px; font-weight: normal; color: #64748b; margin-right: 5px; }
.rs-flag { width: 35px; border-radius: 3px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
/* ثابت کردن سایز کادر لوگوی برند */
.rs-brand-logo {width: 140px !important; height: 45px !important; 
    object-fit: contain; /* این کد باعث میشه عکس بدون دفرمه شدن داخل کادر جا بشه */
    flex-shrink: 0; 
    background: #fff; /* در صورت تمایل می‌تونید بک‌گراند سفید بدید که لوگوهای ترنسپرنت بهتر دیده بشن */
    border-radius: 4px;
}
.rs-price-stock { display: flex; align-items: center; gap: 20px; margin-bottom: 25px; }
.rs-stock-status { padding: 6px 15px; border-radius: 8px; font-size: 14px; font-weight: bold; }
.rs-stock-status.in-stock { background: #dcfce7; color: #16a34a; }
.rs-stock-status.out-of-stock { background: #fee2e2; color: #ef4444; }
.rs-price { font-size: 26px; font-weight: 900; color: #ef4444; }

/* Quick Features */
.rs-quick-features { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 30px; }
.rqf-item { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 15px 5px; text-align: center; display: flex; flex-direction: column; gap: 8px; transition: transform 0.2s; }
.rqf-item:hover { transform: translateY(-3px); border-color: #cbd5e1; }
.rqf-val { font-size: 17px; font-weight: 900; color: #002554; font-family: Arial, sans-serif; }
.rqf-label { font-size: 11px; color: #64748b; font-weight: bold; }

/* Action Box */
.rs-action-box { display: flex; gap: 30px; background: #f1f5f9; padding: 25px; border-radius: 12px; align-items: center; }
.rs-notices { width: 60%; }
.rs-notices strong { display: block; color: #002554; margin-bottom: 12px; font-size: 15px; }
.rs-notices ul { margin: 0; padding-right: 20px; color: #475569; font-size: 13px; line-height: 1.8; }
.rs-add-to-cart { width: 40%; }
.rs-add-to-cart form.cart { display: flex; margin: 0; width: 100%; }
.rs-add-to-cart .quantity { display: none; }
.rs-add-to-cart button.single_add_to_cart_button { background: #f97316; color: #fff; border: none; padding: 15px; border-radius: 8px; font-size: 16px; font-weight: bold; cursor: pointer; width: 100%; transition: background 0.3s; }
.rs-add-to-cart button.single_add_to_cart_button:hover { background: #ea580c; }
.rs-notify-btn { background: #fff; color: #ef4444; border: 2px solid #ef4444; padding: 15px; border-radius: 8px; font-size: 16px; font-weight: bold; cursor: pointer; width: 100%; text-align: center; transition: all 0.3s; }
.rs-notify-btn:hover { background: #fee2e2; }

/* ========================================================
   Tabs Styling (تب‌های توضیحات)
======================================================== */
.ringo-single-tabs { background: #fff; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.03); border: 1px solid #e5e7eb; padding: 35px; margin-bottom: 40px; }
.woocommerce-tabs ul.tabs { display: flex; list-style: none; padding: 0; margin: 0 0 35px 0; gap: 15px; border: none; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; justify-content: flex-start; }
.woocommerce-tabs ul.tabs::-webkit-scrollbar { display: none; }
.woocommerce-tabs ul.tabs li { margin: 0; border: none; background: #f1f5f9; border-radius: 50px; }
.woocommerce-tabs ul.tabs li a { display: block; padding: 12px 25px; font-size: 15px; font-weight: 900; color: #64748b; text-decoration: none; border-radius: 50px; transition: all 0.3s; }
.woocommerce-tabs ul.tabs li.active { background: #002554; }
.woocommerce-tabs ul.tabs li.active a { color: #fff; }

.woocommerce-Tabs-panel { font-size: 15px; line-height: 1.8; color: #475569; }
.woocommerce-Tabs-panel h2 { display: none; } /* مخفی کردن عناوین تکراری تب‌ها */

/* ========================================================
   Attributes Table -> 2-Column Grid (اصلاح کامل جدول مشخصات)
======================================================== */
.woocommerce-product-attributes { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; border: none; width: 100%; margin: 0; padding: 0; }
.woocommerce-product-attributes tbody { display: contents; }
/* قرار دادن عنوان و مقدار در یک خط */
.woocommerce-product-attributes tr { 
    display: flex; 
    flex-direction: row; 
    justify-content: space-between; 
    align-items: center; 
    background: #f8fafc; 
    border-radius: 12px; 
    padding: 15px 25px; 
    border: 1px solid #e2e8f0; 
}
.woocommerce-product-attributes th { 
    width: auto; 
    background: transparent; 
    padding: 0; 
    border: none; 
    color: #64748b; 
    font-size: 14px; 
    text-align: right; 
}
.woocommerce-product-attributes td { 
    width: auto; 
    padding: 0; 
    text-align: left; 
    border: none; 
    font-size: 15px; 
    font-weight: 900; 
    color: #002554; 
}
.woocommerce-product-attributes td p { margin: 0; }

/* ========================================================
   Related Products (کاروسل اصلاح‌شده برای کارت رینگو)
======================================================== */
.ringo-related-products section.related { 
    display: block !important; 
    width: 100%;
}
.ringo-related-products section.related > h2 { 
    display: block !important;
    font-size: 24px !important; 
    font-weight: 900 !important; 
    color: #002554 !important; 
    margin-bottom: 30px !important; 
    text-align: center !important; 
    width: 100%;
}
.ringo-related-products .products {
    display: flex !important; 
    flex-wrap: nowrap !important; 
    overflow-x: auto !important; 
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory; 
    scroll-behavior: smooth; 
    gap: 20px !important; 
    padding: 5px 2px 15px !important;
    margin: 0 !important;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    box-sizing: border-box;
}
.ringo-related-products .products::before, 
.ringo-related-products .products::after { 
    display: none !important; 
}

/* اعمال عرض ثابت به خودِ کارت اختصاصی تا ۳ ستونه و فشرده نشود */
.ringo-related-products .products > .ringo-tire-card,
.ringo-related-products .products > li.product {
    flex: 0 0 270px !important; 
    min-width: 270px !important; 
    max-width: 270px !important; 
    width: 270px !important; 
    margin: 0 !important;
    scroll-snap-align: start;
}

/* زیباسازی اسکرول‌بار */
.ringo-related-products .products::-webkit-scrollbar { height: 8px; }
.ringo-related-products .products::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 10px; }
.ringo-related-products .products::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.ringo-related-products .products::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* تنظیم عرض کارت‌های کاروسل در موبایل (حداکثر ۲ کارت در صفحه با اسکرول نرم) */
@media (max-width: 576px) {
    .ringo-related-products .products {
        gap: 10px !important;
    }
    .ringo-related-products .products > .ringo-tire-card,
    .ringo-related-products .products > li.product {
        flex: 0 0 calc(50% - 5px) !important;
        min-width: 160px !important;
        max-width: calc(50% - 5px) !important;
        width: calc(50% - 5px) !important;
    }
}
/* ========================================================
   Mobile Responsiveness
======================================================== */
@media (max-width: 992px) {
    .ringo-single-top { flex-direction: column; padding: 20px; gap: 25px; }
    .rs-gallery { width: 100%; padding-bottom: 20px; border-bottom: 1px solid #f1f5f9; }
    .rs-summary { width: 100%; }
    
    .rs-header-wrap { flex-direction: column; gap: 15px; align-items: center; text-align: center; }
    .rs-title-area { justify-content: center; }
    
    .rs-price-stock { justify-content: center; flex-direction: column; gap: 12px; }
    
    .rs-quick-features { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    
    .rs-action-box { flex-direction: column; padding: 20px; gap: 20px; text-align: center; }
    .rs-notices { width: 100%; }
    .rs-add-to-cart { width: 100%; }
    
    .ringo-single-tabs { padding: 20px; }
    
    /* جدول مشخصات در موبایل: یک ستونه می‌شود اما همچنان عنوان و مقدار روبروی هم هستند */
    .woocommerce-product-attributes { grid-template-columns: 1fr; gap: 12px; }
    
    .ringo-related-products .products li.product { flex: 0 0 240px !important; min-width: 240px !important; width: 240px !important; }
}