/*
Theme Name: Roden Theme
Theme URI: https://rdn.one
Description: مظهر كنزا — قابل للتخصيص الكامل من لوحة التحكم
Version: 1.0.0
Author: Roddun
Text Domain: roden-theme
*/

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--rt-font, 'Tajawal', sans-serif); background: var(--rt-bg, #f0f2f5); color: var(--rt-text, #1a1a1a); line-height: 1.6; direction: rtl; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color 0.2s; }

/* ===== Container ===== */
.rt-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== Header ===== */
.rt-header { background: var(--rt-header, #075E54); position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 16px rgba(0,0,0,0.2); }
.rt-header-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 16px; }

.rt-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.rt-logo-text { font-size: 22px; font-weight: 800; color: #fff; }

.rt-nav { display: flex; align-items: center; gap: 2px; flex: 1; justify-content: center; }
.rt-nav a { color: rgba(255,255,255,0.8); font-size: 14px; font-weight: 600; padding: 7px 13px; border-radius: 8px; transition: all 0.2s; white-space: nowrap; }
.rt-nav a:hover, .rt-nav a.current { color: #fff; background: rgba(255,255,255,0.12); }

.rt-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.rt-icon-btn { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); display: flex; align-items: center; justify-content: center; color: #fff; cursor: pointer; transition: all 0.2s; position: relative; text-decoration: none; }
.rt-icon-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }

.rt-cart-count { position: absolute; top: -5px; left: -5px; background: var(--rt-primary, #25D366); color: #fff; font-size: 10px; font-weight: 800; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid var(--rt-header, #075E54); }

.rt-btn-cta { background: var(--rt-primary, #25D366); color: var(--rt-btn-text, #fff); padding: 9px 18px; border-radius: 20px; font-size: 13px; font-weight: 700; transition: all 0.2s; white-space: nowrap; }
.rt-btn-cta:hover { opacity: 0.9; color: var(--rt-btn-text, #fff); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }

.rt-burger { display: none; flex-direction: column; gap: 5px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; padding: 8px; cursor: pointer; width: 38px; height: 38px; align-items: center; justify-content: center; }
.rt-burger span { display: block; width: 18px; height: 2px; background: #fff; border-radius: 2px; transition: all 0.3s; }

/* ===== Main ===== */
.rt-main { padding: 28px 0; min-height: 60vh; }
.rt-page-content { background: #fff; border-radius: 12px; box-shadow: var(--rt-page-shadow, 0 2px 12px rgba(0,0,0,0.06)); padding: 28px; }
/* إخفاء العنوان في الصفحات فقط — ليس في المنتجات والمقالات */
.page .entry-title { display: none; }

/* ===== Footer ===== */
.rt-footer { background: var(--rt-footer, #1a1a2e); color: rgba(255,255,255,0.7); padding: 44px 0 20px; margin-top: 32px; }
.rt-footer-grid { display: flex; flex-direction: column; align-items: center; gap: 28px; margin-bottom: 32px; text-align: center; }
.rt-footer-has-links { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; text-align: right; }
.rt-footer-has-links .rt-footer-brand { text-align: right; align-items: flex-start; }
.rt-footer-has-links .rt-footer-social { justify-content: flex-start; }
.rt-footer-brand { display: flex; flex-direction: column; align-items: center; }
.rt-footer-has-links .rt-footer-brand { align-items: flex-start; }
.rt-footer-name { font-size: 22px; font-weight: 800; color: #fff; display: block; margin-bottom: 10px; }
.rt-footer-desc { font-size: 14px; color: rgba(255,255,255,0.45); line-height: 1.7; margin-top: 10px; max-width: 340px; }
.rt-footer-wa { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--rt-primary, #25D366); font-size: 13px; font-weight: 600; }
.rt-footer-links { text-align: right; }
.rt-footer-links h4 { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.5px; }
.rt-footer-links a { display: block; font-size: 14px; color: rgba(255,255,255,0.45); margin-bottom: 10px; transition: color 0.2s; }
.rt-footer-links a:hover { color: var(--rt-primary, #25D366); }
.rt-footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 20px; font-size: 13px; color: var(--rt-footer-text, rgba(255,255,255,0.4)); text-align: center; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .rt-nav { display: none; position: absolute; top: 62px; right: 0; left: 0; background: var(--rt-header, #075E54); flex-direction: column; padding: 10px; gap: 2px; box-shadow: 0 8px 20px rgba(0,0,0,0.2); z-index: 999; }
    .rt-nav.open { display: flex; }
    .rt-nav a { padding: 11px 16px; width: 100%; border-radius: 8px; }
    .rt-burger { display: flex; }
    .rt-footer-grid { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 480px) {
    .rt-header-inner { height: 54px; }
    .rt-page-content { padding: 18px 14px; }
}

/* ===== حدود الصفحة (قابل للتحكم من لوحة التحكم) ===== */
.rt-page-content {
    border: var(--rt-page-border-width, 0px) var(--rt-page-border-style, solid) var(--rt-page-border-color, #e5e7eb);
}

/* ===== WooCommerce — حقل الكمية ===== */
/* إضافة كلمة "الكمية" */
.woocommerce .quantity::before {
    content: 'الكمية:';
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--rt-text, #1a1a1a);
    margin-bottom: 4px;
    font-family: var(--rt-font-b, 'Tajawal', sans-serif);
}
/* تنسيق input الكمية ليأخذ شكل القالب */
.woocommerce .quantity .qty {
    width: 72px !important;
    height: 44px !important;
    border: 2px solid var(--rt-page-border-color, #e5e7eb) !important;
    border-radius: var(--rt-cb-radius, 10px) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    font-family: var(--rt-font-b, 'Tajawal', sans-serif) !important;
    color: var(--rt-text, #1a1a1a) !important;
    text-align: center !important;
    background: #fff !important;
    padding: 0 8px !important;
    -moz-appearance: textfield !important;
    transition: border-color 0.2s !important;
}
.woocommerce .quantity .qty:focus {
    outline: none !important;
    border-color: var(--rt-primary, #25D366) !important;
}
.woocommerce .quantity .qty::-webkit-outer-spin-button,
.woocommerce .quantity .qty::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}
/* تنسيق حقل الكمية في صفحة السلة */
.woocommerce-cart .quantity::before {
    content: none;
}
.woocommerce-cart .quantity .qty {
    width: 64px !important;
    height: 38px !important;
}

/* أزرار صفحة المنتج الإضافية */
.rt-single-btns {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.rt-extra-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    font-family: var(--rt-font-b, 'Tajawal', sans-serif);
    flex: 1;
    min-width: 140px;
}

.rt-extra-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

/* ===== WooCommerce — أزرار السلة والخروج ===== */

/* زر "تحديث السلة" و"متابعة الدفع" في صفحة السلة */
.woocommerce-cart .wc-proceed-to-checkout .checkout-button,
.woocommerce-cart .wc-proceed-to-checkout a.button,
.woocommerce-checkout #place_order,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce a.button,
.woocommerce #respond input#submit {
    background: var(--rt-cb-color, #25D366) !important;
    color: var(--rt-cb-tcolor, #ffffff) !important;
    border-radius: var(--rt-cb-radius, 10px) !important;
    border: none !important;
    font-family: var(--rt-font-b, 'Tajawal', sans-serif) !important;
    font-weight: 700 !important;
    padding: 14px 28px !important;
    font-size: 15px !important;
    transition: all 0.2s !important;
    cursor: pointer !important;
}

.woocommerce-cart .wc-proceed-to-checkout .checkout-button:hover,
.woocommerce-checkout #place_order:hover,
.woocommerce button.button:hover,
.woocommerce a.button:hover {
    opacity: 0.88 !important;
    transform: translateY(-1px) !important;
}

/* زر "إتمام الطلب" — أبرز قليلاً */
.woocommerce-checkout #place_order {
    width: 100%;
    padding: 16px !important;
    font-size: 16px !important;
}

/* زر "متابعة التسوق" */
.woocommerce .return-to-shop .button,
.woocommerce-cart .cart-collaterals .button {
    background: transparent !important;
    color: var(--rt-cb-color, #25D366) !important;
    border: 2px solid var(--rt-cb-color, #25D366) !important;
    border-radius: var(--rt-cb-radius, 10px) !important;
}

/* WooCommerce page layout fix */
.rt-woo-page { max-width: 1200px; margin: 0 auto; padding: 28px 20px; }

.woocommerce-page .rt-main { padding: 0; }

/* أزرار WooCommerce — override قوي */
body.woocommerce-cart a.checkout-button,
body.woocommerce-cart .wc-proceed-to-checkout a,
body.woocommerce-checkout #place_order,
body.woocommerce-checkout button#place_order,
body.woocommerce .button.alt,
body.woocommerce button.button.alt {
    background-color: var(--rt-cb-color, #25D366) !important;
    color: var(--rt-cb-tcolor, #fff) !important;
    border-radius: var(--rt-cb-radius, 10px) !important;
    border: none !important;
    font-weight: 700 !important;
}

/* ===== الهيدر العالمي (Hero) ===== */
.rt-hero-header {
    background: var(--rt-bg, #f0f2f5);
    text-align: center;
    padding-bottom: 20px;
    position: relative;
}

.rt-hero-cover {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--rt-header, #075E54);
}
.rt-hero-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.rt-hero-cover-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--rt-header, #075E54), var(--rt-primary, #25D366));
}

/* زر الحساب فوق الغلاف */
.rt-hero-account-btn {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    transition: all 0.2s;
    text-decoration: none;
}
.rt-hero-account-btn:hover { transform: scale(1.08); }

/* اللوقو الدائري */
.rt-hero-avatar-wrap {
    display: flex;
    justify-content: center;
    margin-top: -44px;
    position: relative;
    z-index: 2;
}
.rt-hero-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    background: #fff;
    display: block;
}

/* معلومات المتجر */
.rt-hero-info {
    padding: 12px 20px 0;
}
.rt-hero-name {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: var(--rt-text, #1a1a1a);
    text-decoration: none;
    margin-bottom: 4px;
}
.rt-hero-city {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--rt-text, #1a1a1a);
    opacity: 0.6;
    margin: 0 0 12px;
}

/* أيقونات التواصل في الهيدر العالمي */
.rt-hero-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.rt-hero-social-link {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.2s;
    text-decoration: none;
}
.rt-hero-social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    color: var(--rt-primary, #25D366);
}
.rt-hero-social-link svg { display: block; }

/* Main بدون padding علوي لما الهيدر عالمي */
.rt-main--hero { padding-top: 16px; }

/* ===== أيقونات التواصل في الفوتر ===== */
.rt-footer-social {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.rt-footer-social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.7);
    transition: all 0.2s;
    text-decoration: none;
}
.rt-footer-social-link:hover {
    background: rgba(255,255,255,0.16);
    color: #fff;
    transform: translateY(-2px);
}
.rt-footer-social-link svg { display: block; }

/* رابط رودن في الفوتر */
.rt-footer-roddun {
    color: var(--rt-footer-text, rgba(255,255,255,0.4));
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s;
}
.rt-footer-roddun:hover { opacity: 0.8; }

/* ===== Social items في الأدمن ===== */
.roden-social-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1.5px solid #e5e7eb;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.roden-social-icon-picker {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.roden-social-icon-preview {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
    flex-shrink: 0;
}
.roden-social-icon-preview svg { display: block; }

/* ===== إصلاح صفحة المنتج المفرد ===== */

/* ١. إزالة الفاصل الأبيض بين الهيدر والمحتوى */
body.single-product .rt-main,
body.woocommerce .rt-main {
    padding-top: 0 !important;
}

/* ٢. حقول المنتج المتغير (select, variations) — تصميم متناسق */
.woocommerce div.product table.variations {
    width: 100%;
    border: none;
}
.woocommerce div.product table.variations td,
.woocommerce div.product table.variations th {
    padding: 8px 0;
    vertical-align: middle;
}
.woocommerce div.product table.variations label {
    font-size: 14px;
    font-weight: 700;
    color: var(--rt-text, #1a1a1a);
    font-family: var(--rt-font-b, 'Tajawal', sans-serif);
}
.woocommerce div.product .variations select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: var(--rt-cb-radius, 10px);
    font-size: 14px;
    font-family: var(--rt-font-b, 'Tajawal', sans-serif);
    color: var(--rt-text, #1a1a1a);
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    cursor: pointer;
    transition: border-color 0.2s;
    direction: rtl;
}
.woocommerce div.product .variations select:focus {
    outline: none;
    border-color: var(--rt-primary, #25D366);
}

/* ٣. زر "أضف للسلة" في صفحة المنتج المفرد */
.woocommerce div.product form.cart .single_add_to_cart_button {
    background: var(--rt-cb-color, #25D366) !important;
    color: var(--rt-cb-tcolor, #ffffff) !important;
    border-radius: var(--rt-cb-radius, 10px) !important;
    border: none !important;
    font-family: var(--rt-font-b, 'Tajawal', sans-serif) !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    padding: 14px 32px !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    width: 100% !important;
    margin-top: 8px !important;
}
.woocommerce div.product form.cart .single_add_to_cart_button:hover {
    opacity: 0.88 !important;
    transform: translateY(-1px) !important;
}

/* ٤. shortcode [products] — شبكة منظمة */
.woocommerce ul.products {
    display: flex !important;
    flex-wrap: wrap !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.woocommerce ul.products li.product {
    box-sizing: border-box !important;
}

