/* =============================================
   أول بصمة — ورقة الأنماط الرئيسية
   ============================================= */

/* المتغيرات */
:root {
    --primary:   #0D3D4E;
    --secondary: #00BCD4;
    --primary-dark: #0a2f3d;
    --secondary-light: #e0f7fa;
    --font-main: 'Tajawal', sans-serif;
}

/* الخط والاتجاه */
* { box-sizing: border-box; }
body {
    font-family: var(--font-main);
    direction: rtl;
    color: #2d2d2d;
    background: #f8f9fb;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
main { flex: 1; }

/* ألوان Bootstrap المخصصة */
.btn-primary      { background: var(--primary);   border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-secondary    { background: var(--secondary); border-color: var(--secondary); color: #fff; }
.btn-secondary:hover { background: #00a5bb; border-color: #00a5bb; }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.text-primary     { color: var(--primary) !important; }
.text-secondary   { color: var(--secondary) !important; }
.bg-primary       { background-color: var(--primary) !important; }
.bg-secondary     { background-color: var(--secondary) !important; }
.border-primary   { border-color: var(--primary) !important; }
.badge.bg-secondary { background-color: var(--secondary) !important; }

/* =============================================
   الهيدر
   ============================================= */
.site-header {
    background: #fff;
    border-bottom: 2px solid #e8eef0;
    box-shadow: 0 2px 15px rgba(13,61,78,.08);
    z-index: 1000;
}
.site-header .navbar { padding: .75rem 0; }
.brand-name    { font-size: 1.2rem; font-weight: 900; color: var(--primary); line-height: 1.2; }
.brand-tagline { font-size: .72rem; color: #6c757d; }
.brand-logo    { color: var(--secondary); }
.site-logo {
    height: 60px; width: auto;
    border-radius: 10px;
    object-fit: contain;
    display: block;
}
@media (max-width: 575px) {
    .site-logo { height: 48px; }
}
.nav-link      { color: var(--primary) !important; font-weight: 600; padding: .5rem .9rem !important; border-radius: 8px; transition: .2s; }
.nav-link:hover, .nav-link.active { background: var(--secondary-light); color: var(--secondary) !important; }
.dropdown-menu { border: 1px solid #e0ecf0; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.1); }
.dropdown-item { font-weight: 500; color: var(--primary); padding: .5rem 1rem; }
.dropdown-item:hover { background: var(--secondary-light); color: var(--secondary); }

/* =============================================
   هيرو الصفحة الرئيسية
   ============================================= */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, #1a5568 50%, #0a7a9a 100%);
    min-height: 520px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2300BCD4' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-section .display-4 { font-weight: 900; }

/* =============================================
   بطاقات المنتجات
   ============================================= */
.product-card {
    border-radius: 14px;
    border: 1px solid #e0ecf0;
    transition: .3s;
    background: #fff;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.product-card:hover { box-shadow: 0 12px 40px rgba(13,61,78,.15); transform: translateY(-4px); }
.product-card .card-img-wrap {
    aspect-ratio: 1;
    background: #f0f5f7;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.product-card .card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: .4s; }
.product-card:hover .card-img-wrap img { transform: scale(1.05); }
.product-card .card-img-placeholder { color: #b0c4cc; font-size: 4rem; }
.product-card .badge-featured { position: absolute; top: 10px; right: 10px; }
.product-card .card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
.product-card .product-category { font-size: .75rem; color: #6c757d; margin-bottom: .25rem; }
.product-card .product-name { font-weight: 800; color: var(--primary); font-size: 1rem; margin-bottom: .5rem; line-height: 1.4; }
.product-card .product-price { font-weight: 900; color: var(--primary); font-size: 1.2rem; }
.product-card .product-original { color: #999; text-decoration: line-through; font-size: .85rem; }
.product-card .card-footer { padding: .75rem 1rem; background: transparent; border-top: 1px solid #f0f5f7; }

/* =============================================
   الفلتر الجانبي (صفحة المتجر)
   ============================================= */
.filter-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e0ecf0;
    padding: 1.25rem;
    position: sticky;
    top: 90px;
}
.filter-card h6 { color: var(--primary); font-weight: 800; margin-bottom: .75rem; }
.filter-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .75rem;
    border-radius: 8px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: .2s;
    margin-bottom: .25rem;
}
.filter-link:hover, .filter-link.active {
    background: var(--secondary-light);
    color: var(--secondary);
}
.filter-link .badge { margin-right: auto; margin-left: 0; }

/* =============================================
   صفحة تفاصيل المنتج
   ============================================= */
.product-detail-img {
    aspect-ratio: 1;
    background: #f0f5f7;
    border-radius: 16px;
    border: 1px solid #e0ecf0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.product-detail-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 16px; }
.qty-control { display: flex; align-items: center; border: 1px solid #dee2e6; border-radius: 10px; overflow: hidden; width: fit-content; }
.qty-control button { width: 44px; height: 44px; border: none; background: #f8f9fa; font-size: 1.3rem; font-weight: bold; cursor: pointer; transition: .2s; }
.qty-control button:hover { background: var(--secondary-light); }
.qty-control input  { width: 60px; text-align: center; border: none; font-size: 1.1rem; font-weight: bold; color: var(--primary); }

/* =============================================
   السلة
   ============================================= */
.cart-item {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e0ecf0;
    padding: 1rem;
    margin-bottom: .75rem;
}
.cart-item .item-img {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    background: #f0f5f7;
    flex-shrink: 0;
    overflow: hidden;
}
.cart-item .item-img img { width: 100%; height: 100%; object-fit: cover; }
.order-summary {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e0ecf0;
    padding: 1.25rem;
    position: sticky;
    top: 90px;
}

/* =============================================
   الدفع والطلبات
   ============================================= */
.checkout-step {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e0ecf0;
    padding: 1.5rem;
    margin-bottom: 1rem;
}
.checkout-step .step-title {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1rem;
}
.step-number {
    width: 32px; height: 32px;
    background: var(--secondary);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: .9rem;
}
.shipping-option, .payment-option {
    border: 2px solid #e0ecf0;
    border-radius: 12px;
    padding: .85rem 1rem;
    cursor: pointer;
    transition: .2s;
    margin-bottom: .5rem;
}
.shipping-option:hover, .payment-option:hover { border-color: var(--secondary); }
.shipping-option.selected, .payment-option.selected { border-color: var(--secondary); background: var(--secondary-light); }

/* =============================================
   لوحة الإدارة
   ============================================= */
.admin-sidebar {
    width: 260px;
    min-height: 100vh;
    background: var(--primary);
    position: fixed;
    top: 0; right: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: .3s;
}
.admin-sidebar .sidebar-brand {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
    text-align: center;
}
.admin-sidebar .sidebar-nav { flex: 1; padding: 1rem 0; }
.admin-sidebar .nav-link {
    color: rgba(255,255,255,.75) !important;
    padding: .7rem 1.5rem !important;
    border-radius: 0 !important;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .75rem;
    transition: .2s;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: rgba(0,188,212,.15);
    color: var(--secondary) !important;
    border-right: 3px solid var(--secondary);
}
.admin-sidebar .nav-link i { width: 20px; text-align: center; }
.admin-content {
    margin-right: 260px;
    min-height: 100vh;
    background: #f0f5f7;
}
.admin-topbar {
    background: #fff;
    border-bottom: 1px solid #e0ecf0;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}
.admin-page { padding: 1.5rem; }
.stat-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e0ecf0;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.stat-card .stat-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.stat-card .stat-value { font-size: 1.8rem; font-weight: 900; color: var(--primary); line-height: 1; }
.stat-card .stat-label { color: #6c757d; font-size: .85rem; margin-top: .25rem; }
.data-table { background: #fff; border-radius: 14px; border: 1px solid #e0ecf0; overflow: hidden; }
.data-table table { margin: 0; }
.data-table thead th { background: #f8f9fb; color: var(--primary); font-weight: 800; border-bottom: 2px solid #e0ecf0; }
.data-table tbody tr:hover { background: #f5fafc; }

/* =============================================
   تأكيد الطلب
   ============================================= */
.order-success-card {
    background: #fff;
    border-radius: 20px;
    border: 2px solid #d4edda;
    padding: 2.5rem;
    text-align: center;
    max-width: 600px;
    margin: 2rem auto;
}
.order-success-icon {
    width: 90px; height: 90px;
    background: #d4edda;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    color: #198754;
}

/* =============================================
   شريط البحث
   ============================================= */
.search-bar {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 50px;
    padding: .5rem 1.25rem;
    color: #fff;
    width: 100%;
    max-width: 400px;
}
.search-bar::placeholder { color: rgba(255,255,255,.7); }
.search-bar:focus { outline: none; background: rgba(255,255,255,.2); }

/* =============================================
   الذيل
   ============================================= */
.site-footer {
    background: var(--primary);
    color: rgba(255,255,255,.9);
    padding: 3.5rem 0 1.5rem;
    border-top: 4px solid var(--secondary);
    margin-top: auto;
}
.footer-links { list-style: none; padding: 0; }
.footer-links li, .footer-links a {
    color: rgba(255,255,255,.72);
    font-size: .88rem;
    text-decoration: none;
    margin-bottom: .4rem;
    display: block;
    transition: .2s;
}
.footer-links a:hover { color: var(--secondary); }

/* =============================================
   متفرقات
   ============================================= */
.page-hero {
    background: linear-gradient(135deg, var(--primary) 0%, #1a5568 100%);
    padding: 2.5rem 0;
    color: #fff;
    border-bottom: 3px solid var(--secondary);
}
.breadcrumb-item a { color: rgba(255,255,255,.75); text-decoration: none; }
.breadcrumb-item.active, .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.6); }
.form-control:focus, .form-select:focus { border-color: var(--secondary); box-shadow: 0 0 0 .25rem rgba(0,188,212,.2); }
.fw-black { font-weight: 900 !important; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* =============================================
   صفحة المنتجات — إحصائيات علوية
   ============================================= */
.products-header-bar {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e0ecf0;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 8px rgba(13,61,78,.04);
}
.products-header-bar .stats-group {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}
.products-header-bar .stat-item {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.products-header-bar .stat-item .stat-num {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
}
.products-header-bar .stat-item .stat-lbl {
    font-size: .78rem;
    color: #6c757d;
    font-weight: 600;
}
.products-header-bar .stat-divider {
    width: 1px;
    height: 32px;
    background: #e0ecf0;
}

/* =============================================
   تبويبات العرض المخصصة
   ============================================= */
.admin-view-tabs {
    display: flex;
    gap: .5rem;
    margin-bottom: 1.25rem;
    background: #fff;
    border-radius: 12px;
    padding: 5px;
    border: 1px solid #e0ecf0;
    width: fit-content;
}
.admin-view-tabs .tab-btn {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1.1rem;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: #6c757d;
    font-weight: 700;
    font-size: .85rem;
    cursor: pointer;
    transition: .2s;
    font-family: var(--font-main);
}
.admin-view-tabs .tab-btn:hover {
    color: var(--primary);
    background: #f0f5f7;
}
.admin-view-tabs .tab-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(13,61,78,.2);
}

/* =============================================
   بطاقات المنتجات — محسّنة للوحة الإدارة
   ============================================= */
.admin-product-card {
    border-radius: 16px;
    border: 1px solid #e4ecf0;
    background: #fff;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: .3s ease;
    position: relative;
}
.admin-product-card:hover {
    box-shadow: 0 16px 48px rgba(13,61,78,.12);
    transform: translateY(-5px);
    border-color: var(--secondary);
}
.admin-product-card .card-img-area {
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #f0f5f7 0%, #e8eef2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.admin-product-card .card-img-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.admin-product-card:hover .card-img-area img {
    transform: scale(1.07);
}
.admin-product-card .card-img-area .placeholder-icon {
    color: #c5d4dc;
    font-size: 3rem;
}
.admin-product-card .card-img-area .img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(13,61,78,.7) 0%, transparent 50%);
    opacity: 0;
    transition: .3s;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 12px;
}
.admin-product-card:hover .card-img-area .img-overlay {
    opacity: 1;
}
.admin-product-card .card-img-area .img-overlay .overlay-actions {
    display: flex;
    gap: .5rem;
}
.admin-product-card .card-img-area .img-overlay .overlay-actions .btn {
    padding: .45rem .9rem;
    border-radius: 10px;
    font-size: .8rem;
    font-weight: 700;
    backdrop-filter: blur(4px);
}
.admin-product-card .card-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    left: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
}
.admin-product-card .card-badges .badge {
    pointer-events: auto;
    padding: .35rem .6rem;
    font-size: .7rem;
    font-weight: 700;
    border-radius: 8px;
    letter-spacing: .02em;
}
.admin-product-card .card-badges .badge-featured {
    background: linear-gradient(135deg, #f0ad4e, #e89a3c);
    color: #fff;
}
.admin-product-card .card-badges .badge-stock-out {
    background: rgba(220,53,69,.9);
    color: #fff;
}
.admin-product-card .card-badges .badge-variants {
    background: rgba(13,202,240,.9);
    color: #fff;
}
.admin-product-card .card-info {
    padding: 1rem 1.15rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}
.admin-product-card .card-category {
    font-size: .7rem;
    font-weight: 700;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.admin-product-card .card-title {
    font-weight: 800;
    color: var(--primary);
    font-size: .95rem;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.admin-product-card .card-pricing {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    margin-top: .25rem;
}
.admin-product-card .card-pricing .current-price {
    font-weight: 900;
    color: var(--primary);
    font-size: 1.15rem;
}
.admin-product-card .card-pricing .old-price {
    color: #adb5bd;
    text-decoration: line-through;
    font-size: .8rem;
}
.admin-product-card .card-meta {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-top: .3rem;
    flex-wrap: wrap;
}
.admin-product-card .card-meta .meta-tag {
    font-size: .68rem;
    font-weight: 600;
    color: #6c757d;
    background: #f4f7f9;
    padding: .2rem .55rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: .3rem;
}
.admin-product-card .card-actions {
    padding: .75rem 1.15rem;
    border-top: 1px solid #f0f4f6;
    display: flex;
    gap: .4rem;
}
.admin-product-card .card-actions .btn {
    flex: 1;
    border-radius: 10px;
    font-weight: 700;
    font-size: .8rem;
    padding: .5rem;
    transition: .2s;
}

/* =============================================
   جدول المنتجات — محسّن
   ============================================= */
.admin-products-table {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e4ecf0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(13,61,78,.04);
}
.admin-products-table table {
    margin: 0;
}
.admin-products-table thead th {
    background: linear-gradient(180deg, #f8f9fb 0%, #f0f4f6 100%);
    color: var(--primary);
    font-weight: 800;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    border-bottom: 2px solid #e4ecf0;
    padding: .85rem 1rem;
    white-space: nowrap;
}
.admin-products-table tbody tr {
    transition: .15s;
}
.admin-products-table tbody tr:hover {
    background: #f5fafc;
}
.admin-products-table tbody td {
    padding: .8rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f0f4f6;
    font-size: .88rem;
}
.admin-products-table .product-cell {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.admin-products-table .product-thumb {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f0f5f7;
    display: flex;
    align-items: center;
    justify-content: center;
}
.admin-products-table .product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.admin-products-table .product-cell .product-info .name {
    font-weight: 800;
    color: var(--primary);
    font-size: .9rem;
    line-height: 1.3;
}
.admin-products-table .product-cell .product-info .sku-label {
    font-size: .68rem;
    color: #adb5bd;
    font-weight: 600;
}
.admin-products-table .stock-badge {
    padding: .3rem .65rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: .78rem;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}
.admin-products-table .stock-badge.in-stock {
    background: #d1e7dd;
    color: #0f5132;
}
.admin-products-table .stock-badge.out-of-stock {
    background: #f8d7da;
    color: #842029;
}

/* =============================================
   نموذج Modal — تحسينات
   ============================================= */
.admin-modal .modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, #1a5568 100%);
    color: #fff;
    border-radius: 0;
    padding: 1.1rem 1.75rem;
    border-bottom: 3px solid var(--secondary);
}
.admin-modal .modal-header .modal-title {
    color: #fff;
    font-size: 1.15rem;
}
.admin-modal .modal-body {
    padding: 0;
    background: #f4f7f9;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
}
.admin-modal .modal-body-inner {
    padding: 1.75rem;
}
.admin-modal .form-section {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e4ecf0;
    margin-bottom: 1.25rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(13,61,78,.03);
}
.admin-modal .form-section .section-header {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    border-bottom: 1px solid #f0f4f6;
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}
.admin-modal .form-section .section-header .section-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    flex-shrink: 0;
}
.admin-modal .form-section .section-header .section-icon.icon-primary {
    background: rgba(13,61,78,.08);
    color: var(--primary);
}
.admin-modal .form-section .section-header .section-icon.icon-secondary {
    background: rgba(0,188,212,.1);
    color: var(--secondary);
}
.admin-modal .form-section .section-header .section-icon.icon-warning {
    background: rgba(255,193,7,.12);
    color: #e0a800;
}
.admin-modal .form-section .section-header .section-icon.icon-info {
    background: rgba(13,202,240,.12);
    color: #0ca3d4;
}
.admin-modal .form-section .section-header h6 {
    margin: 0;
    font-weight: 800;
    font-size: .95rem;
    color: var(--primary);
}
.admin-modal .form-section .section-body {
    padding: 1.25rem 1.5rem;
}
.admin-modal .form-section .form-label {
    font-weight: 700;
    font-size: .82rem;
    color: #495057;
    margin-bottom: .35rem;
}
.admin-modal .form-section .form-control,
.admin-modal .form-section .form-select {
    border-radius: 10px;
    border: 1.5px solid #e0ecf0;
    padding: .55rem .85rem;
    font-size: .88rem;
    transition: .2s;
}
.admin-modal .form-section .form-control:focus,
.admin-modal .form-section .form-select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 .2rem rgba(0,188,212,.15);
}
.admin-modal .form-section .form-text {
    font-size: .72rem;
    color: #adb5bd;
}
.admin-modal .modal-footer {
    background: #fff;
    border-top: 2px solid #e4ecf0;
    padding: 1rem 1.75rem;
    display: flex;
    gap: .75rem;
}
.admin-modal .modal-footer .btn {
    border-radius: 12px;
    font-weight: 700;
    padding: .65rem 1.5rem;
    font-size: .9rem;
    transition: .2s;
}
.admin-modal .form-check-card {
    border: 2px solid #e8eef0;
    border-radius: 12px;
    padding: .85rem 1rem;
    transition: .2s;
    cursor: pointer;
    background: #fff;
}
.admin-modal .form-check-card:hover {
    border-color: var(--secondary);
    background: #f8fffe;
}
.admin-modal .form-check-card.checked {
    border-color: var(--secondary);
    background: rgba(0,188,212,.05);
}
.admin-modal .form-check-card .form-check-input:checked + .form-check-label {
    color: var(--primary);
}

/* جوال */
@media (max-width: 991.98px) {
    .admin-sidebar { display: none; }
    .admin-content { margin-right: 0; }
    .products-header-bar { flex-direction: column; align-items: stretch; }
    .products-header-bar .stats-group { justify-content: center; }
}

/* =============================================
   أزرار المقاسات الجاهزة
   ============================================= */
.size-preset-btn {
    border-radius: 10px !important;
    font-weight: 700;
    font-size: .78rem;
    padding: .4rem .8rem;
    transition: .2s;
    border: 2px solid #e0ecf0 !important;
    color: #495057;
}
.size-preset-btn:hover {
    border-color: var(--secondary) !important;
    color: var(--secondary);
    background: rgba(0,188,212,.05);
}
.size-preset-btn.active {
    background: var(--secondary);
    color: #fff;
    border-color: var(--secondary) !important;
}

/* =============================================
   صفوف تسعير بالكمية
   ============================================= */
.tier-price-row {
    background: #f8f9fb;
    border-radius: 10px;
    padding: .6rem .8rem;
    border: 1px solid #e4ecf0;
}

/* =============================================
   تبديل قسم (Section Toggle)
   ============================================= */
.section-toggle {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.section-toggle .form-switch .form-check-input {
    width: 2.8em;
    height: 1.5em;
}

/* ===== بطاقات الأقسام في الصفحة الرئيسية ===== */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
@media (min-width: 768px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 992px) { .cat-grid { grid-template-columns: repeat(5, 1fr); gap: 1.25rem; } }

.cat-card {
    position: relative;
    display: block;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(0,0,0,.06);
    box-shadow: 0 2px 10px rgba(13,61,78,.05);
    text-decoration: none;
    transition: transform .25s ease, box-shadow .25s ease;
}
.cat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(13,61,78,.16);
}
.cat-card__media {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%; /* مربّع — متوافق مع كل المتصفحات بدل aspect-ratio */
    overflow: hidden;
}
.cat-card__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;   /* إظهار الصورة كاملة داخل المربّع دون قص */
    padding: 10px;
    background: #fff;
    transition: transform .5s ease;
}
.cat-card:hover .cat-card__media img { transform: scale(1.08); }
.cat-card__icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.4rem;
    color: var(--primary);
}
.cat-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(13,61,78,.85) 0%, rgba(13,61,78,.15) 55%, transparent 100%);
    opacity: 0;
    transition: opacity .25s ease;
}
.cat-card:hover .cat-card__overlay { opacity: 1; }
.cat-card__cta {
    position: absolute;
    inset-inline-end: .6rem;
    bottom: .6rem;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--secondary, #00BCD4);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(8px);
    opacity: 0;
    transition: transform .25s ease, opacity .25s ease;
    z-index: 2;
}
.cat-card:hover .cat-card__cta { transform: translateY(0); opacity: 1; }
.cat-card__body { padding: .85rem .75rem; text-align: center; }
.cat-card__name {
    font-weight: 800;
    color: var(--primary);
    font-size: .95rem;
    margin-bottom: .35rem;
    line-height: 1.3;
}
.cat-card__count {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    color: var(--secondary, #00BCD4);
    background: rgba(0,188,212,.12);
    padding: .12rem .6rem;
    border-radius: 999px;
}
