/* 
 * Rukn Store - Main Premium CSS Stylesheet (RTL)
 * تصميم متجر ركن للملابس الرجالية الفاخرة
 * يعتمد التصميم على مبدأ البساطة والفخامة (Minimalist Luxury)
 */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&display=swap');

:root {
    /* الألوان الأساسية والمحايدة */
    --bg-main: #FAFAF9; /* أوف وايت ناعم ومريح */
    --bg-white: #FFFFFF;
    --primary: #1C1917; /* أسود حجري فخم */
    --primary-light: #292524;
    --accent: #C5A880; /* ذهبي باهت/بيج دافئ للفخامة */
    --accent-hover: #B59870;
    --text-dark: #1C1917;
    --text-muted: #78716C; /* رمادي دافئ */
    --text-light: #A8A29E;
    --border-color: #E7E5E4; /* حدود خفيفة جداً */
    --border-focus: #C5A880;
    --success: #10B981;
    --danger: #EF4444;
    
    /* الخطوط والمقاسات */
    --font-family: 'Cairo', sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.04);
}

/* تنسيقات أساسية للموقع */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    font-family: var(--font-family);
    direction: rtl;
    text-align: right;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* تخطيط الصفحة */
.container {
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 24px;
}

/* رأس الصفحة (Header) */
header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition-smooth);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 95px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 85px; /* تكبير حجم اللوجو للفخامة والوضوح */
    max-height: 90px;
    width: auto;
    object-fit: contain;
    transition: var(--transition-fast);
}

.logo img:hover {
    transform: scale(1.03);
}

.logo-text {
    display: none;
}

/* قائمة التصفح للحاسوب */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-link {
    font-weight: 500;
    font-size: 15px;
    color: var(--text-dark);
    position: relative;
    padding: 8px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: var(--transition-smooth);
}

.nav-link:hover {
    color: var(--accent);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active {
    color: var(--accent);
    font-weight: 600;
}

.nav-link.active::after {
    width: 100%;
}

/* أيقونات الهيدر */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dark);
    position: relative;
    padding: 6px;
    border-radius: 50%;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background-color: var(--bg-main);
    color: var(--accent);
}

.cart-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: var(--accent);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* قائمة الهواتف */
.menu-toggle {
    display: none;
}

/* شريط البحث المنزلق */
.search-bar-container {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    box-shadow: var(--shadow-md);
    display: none;
    z-index: 99;
}

.search-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.search-input {
    flex: 1;
    border: none;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 14px;
}

.search-submit {
    background-color: var(--primary);
    color: var(--bg-white);
    border: none;
    padding: 0 24px;
    font-family: inherit;
    cursor: pointer;
    font-weight: 600;
}

.search-submit:hover {
    background-color: var(--accent);
}

/* قسم الـ Hero (البانر الرئيسي) */
.hero-section {
    position: relative;
    height: 600px;
    background-color: #EFECE9;
    display: flex;
    align-items: center;
    overflow: hidden;
    margin-bottom: 60px;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(250,250,249,0.95) 30%, rgba(250,250,249,0.4) 70%, rgba(250,250,249,0) 100%);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 550px;
    padding-right: 20px;
}

.hero-tagline {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 12px;
    display: inline-block;
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.hero-desc {
    font-size: 16px;
    color: #FFFFFF;
    margin-bottom: 32px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.btn {
    display: inline-block;
    padding: 14px 36px;
    background-color: var(--primary);
    color: var(--bg-white);
    font-weight: 600;
    font-size: 15px;
    border: 1px solid var(--primary);
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: center;
}

.btn:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--primary);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-secondary:hover {
    background-color: var(--primary);
    color: var(--bg-white);
}

.btn-full {
    width: 100%;
}

/* قسم الفئات (Categories Section) */
.section-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.section-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-dark);
}

.section-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-link:hover {
    color: var(--primary);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 60px;
}

.category-card {
    position: relative;
    height: 280px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #EAEAEA;
    box-shadow: var(--shadow-sm);
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.category-card:hover img {
    transform: scale(1.05);
}

.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.1) 60%, rgba(0,0,0,0) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    z-index: 2;
}

.category-name {
    color: var(--bg-white);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.category-btn {
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* شبكة المنتجات (Products Grid) */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 60px;
}

@media (max-width: 1100px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

.product-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition-smooth);
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(197, 168, 128, 0.5);
}

.product-image-wrapper {
    display: block;
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    background-color: #F8F8F8;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.4s ease;
}

.product-image-wrapper .img-primary {
    position: relative;
    z-index: 1;
}

.product-image-wrapper .img-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.product-card:hover .product-image-wrapper .img-primary {
    transform: scale(1.05);
}

.product-card:hover .product-image-wrapper .img-hover {
    opacity: 1;
    transform: scale(1.05);
}

/* الشارات (Badges) */
.badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: var(--primary);
    color: var(--bg-white);
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    z-index: 10;
}

.badge.badge-sale {
    background-color: var(--danger);
}

.badge.badge-new {
    background-color: var(--accent);
    color: var(--primary);
}

.badge.badge-shipping {
    background-color: #10B981;
}

.product-info {
    padding: 14px 16px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-category {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.product-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    min-height: 40px;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-title a {
    color: var(--text-dark);
    transition: var(--transition-fast);
}

.product-title a:hover,
.product-card:hover .product-title a {
    color: var(--accent);
}

.product-price-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    margin-bottom: 0;
}

.product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
}

.product-old-price {
    font-size: 13px;
    text-decoration: line-through;
    color: var(--text-light);
}

.product-discount {
    font-size: 11px;
    color: var(--danger);
    font-weight: 600;
    background-color: #FEF2F2;
    padding: 2px 6px;
    border-radius: 4px;
}

.product-action-btn {
    display: none !important;
}

/* صفحة المتجر والموقع المتكامل (Shop Page) */
.shop-layout {
    display: block;
    width: 100%;
    margin-bottom: 60px;
}

/* خلفية التعتيم للنافذة الجانبية (Drawer Overlay) */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 1090;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* النافذة الجانبية المنزلقة للفلاتر (Offcanvas Filter Drawer) */
.filter-drawer {
    position: fixed;
    top: 0;
    right: -450px;
    width: 420px;
    max-width: 92vw;
    height: 100vh;
    height: 100dvh;
    background-color: var(--bg-white);
    z-index: 1100;
    box-shadow: -8px 0 35px rgba(0, 0, 0, 0.16);
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.filter-drawer.active {
    right: 0;
}

/* رأس النافذة الجانبية */
.filter-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    background-color: #FAFAFA;
}

.filter-drawer-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.filter-drawer-close {
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.filter-drawer-close:hover {
    background-color: #ECECEC;
    color: var(--text-dark);
}

/* جسم النافذة الجانبية */
.filter-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.filter-section {
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.filter-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.filter-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.filter-item label:hover {
    color: var(--text-dark);
}

.filter-item input[type="radio"],
.filter-item input[type="checkbox"] {
    accent-color: var(--primary);
    width: 17px;
    height: 17px;
    cursor: pointer;
}

/* أزرار المقاسات بنمط حديث */
.size-pills-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.size-pill-option {
    cursor: pointer;
    user-select: none;
}

.size-pill-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.size-pill-option span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
    transition: var(--transition-fast);
    background: #FFFFFF;
}

.size-pill-option:hover span {
    border-color: var(--text-dark);
}

.size-pill-option input:checked + span {
    background-color: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
}

/* ألوان الفلاتر Swatches */
.color-swatches-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.color-swatch-item {
    cursor: pointer;
    user-select: none;
}

.color-swatch-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.color-swatch-box {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: block;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15);
    transition: transform var(--transition-fast);
}

.color-swatch-item:hover .color-swatch-box {
    transform: scale(1.1);
}

.color-swatch-item input:checked + .color-swatch-box {
    box-shadow: 0 0 0 2px var(--bg-white), 0 0 0 4px var(--accent);
}

/* أسفل النافذة الجانبية */
.filter-drawer-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background-color: #FAFAFA;
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-apply-filters {
    flex: 2;
    padding: 12px;
    font-size: 14px;
    font-weight: 700;
    background-color: var(--primary);
    color: #FFFFFF;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: var(--transition-fast);
}

.btn-apply-filters:hover {
    background-color: #2a2a2a;
}

.btn-reset-filters {
    flex: 1;
    padding: 11px;
    font-size: 13px;
    font-weight: 600;
    background-color: transparent;
    color: var(--danger);
    border: 1px solid #FECACA;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
    transition: var(--transition-fast);
}

.btn-reset-filters:hover {
    background-color: #FEF2F2;
    border-color: var(--danger);
}

/* شريط التحكم العلوي للمتجر (Shop Controls Toolbar) */
.shop-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px 20px;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.shop-controls-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-filter-drawer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background-color: var(--primary);
    color: #FFFFFF;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.btn-filter-drawer:hover {
    background-color: #2a2a2a;
    transform: translateY(-1px);
}

.filter-badge {
    background-color: var(--accent);
    color: #000000;
    font-size: 11px;
    font-weight: 800;
    border-radius: 12px;
    padding: 2px 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.results-count {
    font-size: 14px;
    color: var(--text-muted);
}

.shop-controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* شريط الفلاتر النشطة (Active Filters Chips Bar) */
.active-filters-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark);
    text-decoration: none;
    transition: var(--transition-fast);
}

.active-filter-chip:hover {
    background-color: #FEE2E2;
    border-color: #FCA5A5;
    color: var(--danger);
}

.active-filter-chip i {
    font-size: 11px;
    color: var(--text-muted);
}

.active-filter-chip:hover i {
    color: var(--danger);
}

.clear-all-chips {
    font-size: 12px;
    font-weight: 700;
    color: var(--danger);
    text-decoration: underline;
    margin-right: 8px;
    cursor: pointer;
}

.sort-select {
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    background-color: var(--bg-white);
}

/* الترقيم (Pagination) */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.page-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-weight: 600;
    background-color: var(--bg-white);
}

.page-link:hover, .page-link.active {
    background-color: var(--primary);
    color: var(--bg-white);
    border-color: var(--primary);
}

/* صفحة تفاصيل المنتج (Product Detail Page) */
.product-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 40px;
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 32px;
    margin-bottom: 60px;
    align-items: start;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

/* معرض الصور (Image Gallery) */
.gallery-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    max-width: 100%;
    width: 100%;
}

.main-image-wrapper {
    width: 100%;
    max-width: 480px;
    aspect-ratio: 3 / 4;
    max-height: 540px;
    margin: 0 auto;
    background-color: #FAFAFA;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.main-image-wrapper img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.35s ease, opacity 0.25s ease;
}

.main-image-wrapper:hover img {
    transform: scale(1.03);
}

.thumbnails-wrapper {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 2px 8px 2px;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
    -webkit-overflow-scrolling: touch;
}

.thumbnails-wrapper::-webkit-scrollbar {
    height: 4px;
}

.thumbnails-wrapper::-webkit-scrollbar-track {
    background: #F3F4F6;
    border-radius: 4px;
}

.thumbnails-wrapper::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 4px;
}

.thumbnails-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.thumbnail-item {
    flex: 0 0 74px;
    width: 74px;
    height: 92px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    cursor: pointer;
    background-color: #FAFAFA;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.thumbnail-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumbnail-item.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

/* معلومات المنتج وتأكيد الطلب */
.detail-info {
    display: flex;
    flex-direction: column;
}

.detail-badge-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.detail-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 16px;
}

.detail-price-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.detail-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-dark);
}

.detail-old-price {
    font-size: 18px;
    text-decoration: line-through;
    color: var(--text-light);
}

.detail-discount {
    font-size: 13px;
    color: var(--danger);
    background-color: #FEF2F2;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 700;
}

.detail-desc {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.7;
}

/* خيارات الألوان والمقاسات */
.option-group {
    margin-bottom: 24px;
}

.option-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
}

.option-label span {
    color: var(--text-muted);
    font-weight: 400;
    margin-right: 6px;
}

.color-swatches {
    display: flex;
    gap: 12px;
}

.swatch-option {
    position: relative;
}

.swatch-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.swatch-visual {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: block;
    transition: var(--transition-smooth);
}

.swatch-option input[type="radio"]:checked + .swatch-visual {
    border-color: var(--accent);
    transform: scale(1.1);
    box-shadow: 0 0 0 2px var(--bg-white) inset;
}

/* أزرار المقاسات */
.size-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.size-option {
    position: relative;
}

.size-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.size-label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition-smooth);
    background-color: var(--bg-white);
    padding: 0 10px;
}

.size-option input[type="radio"]:checked + .size-label {
    background-color: var(--primary);
    color: var(--bg-white);
    border-color: var(--primary);
}

.size-option.disabled .size-label {
    opacity: 0.4;
    background-color: #F5F5F4;
    text-decoration: line-through;
    cursor: not-allowed;
}

/* اختيار الكمية والطلب */
.purchase-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: center;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    height: 48px;
}

.qty-btn {
    background: none;
    border: none;
    width: 40px;
    height: 100%;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background-color: var(--bg-main);
}

.qty-input {
    width: 40px;
    height: 100%;
    border: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    text-align: center;
    font-family: inherit;
    font-weight: 700;
    font-size: 16px;
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* زر التوصيل مجاني */
.shipping-info-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #ECFDF5;
    border: 1px solid #A7F3D0;
    color: #065F46;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
}

/* سلة المشتريات (Cart Page) */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
    margin-bottom: 60px;
}

.cart-table-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
}

.cart-item:first-child {
    padding-top: 0;
}

.cart-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cart-item-image {
    width: 80px;
    aspect-ratio: 3/4;
    background-color: #F5F5F5;
    border-radius: 4px;
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.cart-item-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    gap: 12px;
}

.cart-item-price {
    font-size: 15px;
    font-weight: 700;
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
}

.cart-item-subtotal {
    font-size: 16px;
    font-weight: 800;
}

.remove-cart-item {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* ملخص الطلب والـ Checkout Card */
.summary-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    align-self: flex-start;
}

.summary-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: 14px;
}

.summary-row-total {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    font-weight: 800;
    font-size: 18px;
    color: var(--text-dark);
}

.cod-badge {
    background-color: #FEF3C7;
    border: 1px solid #FCD34D;
    color: #92400E;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
}

/* صفحة تأكيد الطلب والدفع (Checkout Page) */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 380px; /* متناسق مع حجم سلة التسوق */
    gap: 40px;
    margin-bottom: 60px;
}

.checkout-form-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 32px;
}

.form-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-dark);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 15px;
    background-color: var(--bg-main);
    transition: var(--transition-smooth);
}

.form-control:focus {
    border-color: var(--accent);
    background-color: var(--bg-white);
    outline: none;
    box-shadow: 0 0 0 3px rgba(197, 168, 128, 0.15);
}

/* تنسيق حقول الإدخال مع الأيقونات (RTL) */
.input-with-icon-wrapper {
    position: relative;
    width: 100%;
}

.input-with-icon-wrapper .input-icon {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
    transition: var(--transition-smooth);
    z-index: 5;
}

.input-with-icon-wrapper .form-control {
    padding-right: 44px; /* مسافة للأيقونة على اليمين */
}

.input-with-icon-wrapper .form-control:focus + .input-icon {
    color: var(--accent);
}

/* قائمة اقتراحات إكمال اسم المدينة (City Autocomplete Suggestions) */
.city-suggestions-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-height: 220px;
    overflow-y: auto;
    z-index: 1050;
}

.city-suggestion-item {
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    border-bottom: 1px solid #F5F5F4;
    display: flex;
    align-items: center;
    gap: 10px;
}

.city-suggestion-item:last-child {
    border-bottom: none;
}

.city-suggestion-item i {
    font-size: 13px;
    color: var(--accent);
}

.city-suggestion-item:hover,
.city-suggestion-item.active {
    background-color: #FAF8F5;
    color: var(--primary);
    font-weight: 600;
}

.city-suggestion-item mark {
    background: transparent;
    color: var(--accent);
    font-weight: 700;
}

/* تنسيق قائمة مراجعة منتجات الطلب في صفحة Checkout */
.checkout-items-list {
    max-height: 320px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.checkout-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
    gap: 16px;
}

.checkout-item-row:last-child {
    border-bottom: none;
}

.checkout-item-media {
    width: 54px;
    aspect-ratio: 3 / 4;
    background-color: #F5F5F4;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}

.checkout-item-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.checkout-item-qty-badge {
    position: absolute;
    top: -6px;
    left: -6px; /* من جهة اليسار لأن الاتجاه RTL */
    background-color: var(--primary);
    color: var(--bg-white);
    border-radius: 50%;
    font-size: 10px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 1.5px solid var(--bg-white);
    box-shadow: var(--shadow-sm);
}

.checkout-item-info {
    flex: 1;
}

.checkout-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
    line-height: 1.4;
}

.checkout-item-meta {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
}

.checkout-item-price-col {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
}

.checkout-summary-details {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}


/* صفحة نجاح الطلب (Order Success) */
.success-container {
    max-width: 600px;
    margin: 60px auto;
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.success-icon {
    font-size: 64px;
    color: var(--success);
    margin-bottom: 20px;
}

.success-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 12px;
}

.success-message {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 30px;
}

.order-details-card {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    text-align: right;
    margin-bottom: 30px;
}

.order-detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
}

.order-detail-row:last-child {
    margin-bottom: 0;
}

/* زر واتساب العائم */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    color: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: var(--transition-smooth);
}

.whatsapp-float:hover {
    transform: scale(1.1);
    background-color: #20BA5A;
}

/* تذييل الصفحة (Footer) */
footer {
    background-color: var(--primary);
    color: #FFFFFF;
    padding: 60px 0 20px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo img {
    height: 48px;
    margin-bottom: 16px;
}

.footer-desc {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 20px;
    max-width: 320px;
}

.footer-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 30px;
    height: 2px;
    background-color: var(--accent);
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-link {
    font-size: 14px;
    color: var(--text-light);
}

.footer-link:hover {
    color: var(--accent);
    padding-right: 6px;
}

.contact-info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 14px;
    color: var(--text-light);
}

.contact-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    transition: var(--transition-smooth);
}

.social-btn:hover {
    background-color: var(--accent);
    color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
}

/* شاشة فارغة (Empty States) */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 48px;
    color: var(--text-light);
    margin-bottom: 16px;
}

/* التجاوب والشاشات الصغيرة (Responsive Design - Mobile First Media Queries) */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .product-detail-layout {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 24px;
    }
    
    .gallery-container {
        max-width: 480px;
        margin: 0 auto;
    }
    
    .main-image-wrapper {
        max-width: 460px;
        max-height: 480px;
    }
    
    .cart-layout, .checkout-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .checkout-form-card, .summary-card {
        width: 100% !important;
        align-self: stretch !important;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .header-container {
        height: 80px;
    }
    
    .logo img {
        height: 74px;
        max-height: 76px;
    }

    /* تفاصيل المنتج وتجاوب المعرض على الأجهزة اللوحية والمحمولة */
    .product-detail-layout {
        padding: 18px 16px;
        gap: 24px;
        margin-bottom: 40px;
        border-radius: 12px;
    }
    
    .gallery-container {
        max-width: 100%;
    }
    
    .main-image-wrapper {
        max-width: 100%;
        max-height: 420px;
        aspect-ratio: 4 / 5;
    }
    
    .thumbnails-wrapper {
        gap: 8px;
        padding: 4px 2px 6px 2px;
        max-width: 100%;
    }
    
    .thumbnail-item {
        flex: 0 0 64px;
        width: 64px;
        height: 80px;
    }
    
    .detail-title {
        font-size: 22px;
        margin-bottom: 12px;
    }

    /* تفعيل Mobile Menu */
    .nav-menu {
        position: fixed;
        top: 80px;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: calc(100vh - 80px);
        background-color: var(--bg-white);
        flex-direction: column;
        gap: 20px;
        padding: 30px 24px;
        box-shadow: -4px 0 15px rgba(0,0,0,0.05);
        transition: var(--transition-smooth);
        z-index: 99;
    }
    
    .nav-menu.open {
        right: 0;
    }
    
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        font-size: 24px;
        cursor: pointer;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .hero-section {
        height: 450px;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .product-detail-layout {
        padding: 14px 12px;
        gap: 16px;
        margin-bottom: 30px;
        border-radius: 10px;
    }
    
    .main-image-wrapper {
        max-width: 100%;
        max-height: 350px;
        aspect-ratio: 4 / 5;
        border-radius: 8px;
    }
    
    .thumbnails-wrapper {
        gap: 6px;
        padding: 2px 0 6px 0;
    }
    
    .thumbnail-item {
        flex: 0 0 54px;
        width: 54px;
        height: 68px;
        border-radius: 5px;
    }
    
    .detail-title {
        font-size: 19px;
        margin-bottom: 10px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .product-title {
        font-size: 13px;
        height: 36px;
        margin-bottom: 6px;
    }
    
    .product-price {
        font-size: 14px;
    }
    
    .product-old-price {
        font-size: 11px;
    }
    
    .product-action-btn {
        padding: 8px 0;
        font-size: 12px;
    }
    
    .filter-drawer {
        width: 100%;
        max-width: 100vw;
    }
    
    .hero-section {
        height: 380px;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .header-container {
        padding: 0 12px;
    }
}
