/**
 * Main Stylesheet
 * Classic Light Theme (White and Black) with RTL Support
 * Arabic E-commerce Website - Optimized for Mobile Clarity
 * FOOTER FIXED: Corrected to appear at the bottom of the page content.
 * ANIMATION ADDITIONS: Added simple and elegant animations for small and large screens.
 *
 * 🌟 التعديلات المطبقة:
 * 1. تحديد جميع المتغيرات الأساسية للثيم الأبيض والأسود.
 * 2. تم إعادة تعيين متغيرات الألوان (primary, secondary, text, background, card, border, shadow) لضمان التباين العالي (High Contrast).
 * 3. تم الحفاظ على لون التمييز (Accent) البرتقالي (#ff4500) لزر الـ btn-primary وعناصر التمييز.
 */


/* ===== CSS Variables (UPDATED FOR HIGH-CONTRAST LIGHT THEME) ===== */

:root {
    --white: #ffffff;
    --black: #000000;
    --dark-gray: #333333;
    --light-gray: #f5f5f5;
    /* لون خلفية ثانوي خفيف جداً */
    /* 🌟 متغيرات الألوان الأساسية للثيم الأبيض (لضمان الوضوح) */
    --primary-color: var(--black);
    /* اللون الأساسي: أسود (للعناوين والروابط البارزة) */
    --secondary-color: var(--dark-gray);
    /* اللون الثانوي: رمادي داكن (للروابط عند المرور/النص الثانوي) */
    --text-primary: var(--black);
    /* لون النص الأساسي: أسود */
    --text-secondary: var(--dark-gray);
    /* لون النص الثانوي: رمادي داكن */
    --light-background: var(--white);
    /* لون الخلفية الأساسية: أبيض */
    --card-background: var(--white);
    /* لون خلفية الكاردات: أبيض */
    --border-color: #ddd;
    /* لون الحدود: رمادي فاتح جداً (للتفريق عن الخلفية البيضاء) */
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    /* ظل خفيف وواضح */
    --shadow-accent: 0 4px 12px rgba(0, 0, 0, 0.15);
    /* 🌟 تم الحفاظ على لون التمييز البرتقالي للزر الرئيسي (Primary Button) */
    --accent: #ff4500;
    --accent-hover: #e03d00;
    --dark-accent: #f0f0f0;
    /* خلفية خفيفة جداً Hover/Active */
    /* 🌟 ألوان خاصة */
    --success: #28a745;
    --danger: #dc3545;
    --transition: all 0.3s ease;
    --border-radius: 8px;
    --hover-scale-small: scale(1.05);
}


/* ===== Reset & Base Styles ===== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* 🌟 استخدام متغير الخلفية الأبيض والنص الأسود */
    background-color: var(--light-background);
    color: var(--text-primary);
    line-height: 1.6;
    direction: rtl;
    padding-top: 80px;
    padding-bottom: 50px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}


/* ===== Typography ===== */

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--primary-color);
    margin-bottom: 0.8rem;
    font-weight: 700;
}

h1 {
    font-size: 2.2rem;
}

h2 {
    font-size: 1.8rem;
}

h3 {
    font-size: 1.3rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    /* 🌟 تم تعديل هذا السطر لاستخدام primary-color (الأسود) */
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.gold-text {
    color: var(--primary-color);
    font-weight: 700;
}


/* ===== Header Styles ===== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--light-background);
    /* 🌟 أبيض */
    border-bottom: 1px solid var(--border-color);
    /* 🌟 حدود فاتحة */
    box-shadow: var(--shadow);
    z-index: 1000;
    padding: 0.75rem 0;
    transition: var(--transition);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.logo h1 {
    font-size: 1.3rem;
    margin: 0;
    color: var(--primary-color);
}

.logo a {
    color: var(--primary-color);
}

.logo a:hover {
    color: var(--secondary-color);
}


/* Search Bar */

.search-container {
    flex: 1;
    max-width: 450px;
    position: relative;
}

.search-form {
    display: flex;
    position: relative;
    width: 100%;
}

.search-input {
    flex: 1;
    width: 100%;
    padding: 0.6rem 3rem 0.6rem 0.8rem;
    border: 1px solid var(--border-color);
    background: var(--light-background);
    /* 🌟 أبيض */
    color: var(--text-primary);
    /* 🌟 أسود */
    border-radius: var(--border-radius);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.search-btn {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.3rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.search-btn:hover {
    background: var(--dark-accent);
    /* 🌟 خلفية خفيفة جداً للتمرير */
    transform: translateY(-50%) var(--hover-scale-small);
}

.search-icon {
    font-size: 1rem;
    color: var(--primary-color);
}


/* Cart Icon */

.cart-icon-container {
    position: relative;
}

.cart-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: var(--light-background);
    /* 🌟 أبيض */
    border: 1px solid var(--border-color);
    /* 🌟 حدود فاتحة */
    border-radius: 50%;
    transition: var(--transition);
}

.cart-icon-link:hover {
    background: var(--dark-accent);
    /* 🌟 خلفية خفيفة جداً للتمرير */
    transform: var(--hover-scale-small);
}

.cart-icon {
    font-size: 1.3rem;
    color: var(--primary-color);
}

.cart-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    background: var(--danger);
    /* أحمر */
    color: var(--white);
    /* أبيض */
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}


/* User Profile Container */

.user-profile-container {
    display: flex;
    align-items: center;
}


/* WhatsApp Button */

.whatsapp-btn-container {
    margin-left: 1rem;
}


/* WhatsApp is kept green for branding */

.whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: #25d366;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(37, 211, 102, 0.3);
}

.whatsapp-btn:hover {
    transform: var(--hover-scale-small);
}

.whatsapp-icon {
    font-size: 1.3rem;
}


/* ===== Main Content (Adjusted padding to ensure footer is visible) ===== */

.main-content {
    min-height: calc(100vh - 80px);
    padding: 2rem 0;
}


/* ===== Product Grid ===== */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.product-card {
    background: var(--card-background);
    /* 🌟 أبيض */
    border: 1px solid var(--border-color);
    /* 🌟 حدود فاتحة */
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow);
    animation: fadeInUp 0.5s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}


/* 🌟 Keyframe for smooth product entry */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--dark-accent);
    /* 🌟 خلفية خفيفة جداً للصور */
    transition: var(--transition);
}

.product-image:hover {
    transform: scale(1.02);
}

.product-info {
    padding: 1rem;
    text-align: right;
}

.product-name {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.product-description {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    color: var(--accent);
    /* 🌟 سعر المنتج بلون التمييز (برتقالي) */
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.product-stock {
    font-size: 0.75rem;
    margin-bottom: 0.6rem;
}

.in-stock {
    color: var(--success);
}

.out-of-stock {
    color: var(--danger);
}


/* ===== Button Styles (Black/White Frame) - تركيز قوي على وضوح الزر الرئيسي ===== */

.btn {
    display: inline-block;
    padding: 0.7rem 1.4rem;
    border: 1px solid var(--border-color);
    /* 🌟 حدود فاتحة */
    border-radius: var(--border-radius);
    background: transparent;
    color: var(--primary-color);
    /* 🌟 نص أسود */
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    /* 🌟 الزر الرئيسي بلون التمييز (برتقالي) */
    color: var(--white);
    /* 🌟 نص أبيض */
    border-color: var(--accent);
    /* 🌟 حدود بلون التمييز */
    width: 100%;
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(255, 69, 0, 0.3);
    /* 🌟 ظل برتقالي خفيف ليبرز الزر */
}

.btn-primary:disabled {
    background: var(--dark-accent);
    color: var(--text-secondary);
    cursor: not-allowed;
    border-color: var(--dark-accent);
    transform: none;
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    /* 🌟 إطار أسود واضح */
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
    border: 1px solid var(--danger);
}

.btn-danger:hover {
    background: #d32f2f;
    transform: translateY(-1px);
}


/* ===== Page Title ===== */

.page-title {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    /* 🌟 حدود فاتحة */
}


/* ===== Cart & Invoice Styles (وضوح عناصر الجدول) ===== */

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: var(--card-background);
    /* 🌟 أبيض */
    border-radius: var(--border-radius);
    overflow: hidden;
}

.cart-table th {
    background: var(--dark-accent);
    /* 🌟 خلفية فاتحة جداً للتمييز */
    color: var(--text-primary);
    font-weight: 600;
}

.cart-table th,
.cart-table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    /* 🌟 حدود فاتحة */
}

.cart-table tr:hover {
    background: var(--dark-accent);
    transform: scale(1.01);
    box-shadow: var(--shadow);
}

.cart-summary {
    background: var(--card-background);
    /* 🌟 أبيض */
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    margin-top: 2rem;
    transition: var(--transition);
}

.cart-total {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 1rem;
}

.quantity-input {
    width: 60px;
    padding: 0.5rem;
    text-align: center;
    border: 1px solid var(--border-color);
    background: var(--light-background);
    /* 🌟 أبيض */
    color: var(--text-primary);
    border-radius: var(--border-radius);
    transition: var(--transition);
}


/* ===== Form Styles (وضوح حقول الإدخال) ===== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    /* 🌟 حدود فاتحة */
    background: var(--light-background);
    /* 🌟 أبيض */
    color: var(--text-primary);
    /* 🌟 أسود */
    border-radius: var(--border-radius);
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}


/* ===== Invoice Styles (White Paper Look) ===== */

.invoice-container {
    max-width: 800px;
    margin: 2rem auto;
    background: var(--white);
    /* 🌟 أبيض فاقع */
    color: var(--text-primary);
    /* 🌟 أسود */
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-accent);
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.invoice-header {
    text-align: center;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.invoice-details {
    margin-bottom: 2rem;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.invoice-table th,
.invoice-table td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    /* 🌟 حدود فاتحة */
    text-align: right;
    color: var(--text-primary);
}

.invoice-table th {
    background: var(--dark-accent);
    color: var(--text-primary);
}


/* ===== Mobile Categories Navigation (Fixed Bottom) ===== */

.mobile-categories-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--light-background);
    /* 🌟 أبيض */
    border-top: 1px solid var(--border-color);
    /* 🌟 حدود فاتحة */
    padding: 0.5rem 0;
    z-index: 1000;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0.5;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mobile-categories-nav ul {
    list-style: none;
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.mobile-categories-nav ul::-webkit-scrollbar {
    display: none;
}

.mobile-categories-nav li {
    flex: 0 0 auto;
    text-align: center;
}

.mobile-categories-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    border-radius: var(--border-radius);
    min-width: 60px;
}

.mobile-categories-nav a:hover,
.mobile-categories-nav a.active {
    color: var(--primary-color);
    background: var(--dark-accent);
    transform: translateY(-2px);
}

.mobile-categories-nav .category-icon {
    font-size: 1.3rem;
}

.mobile-categories-nav .category-name {
    font-size: 0.65rem;
    font-weight: 600;
}


/* ===== Footer Styles (UNFIXED - At bottom of content) ===== */

.site-footer {
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--light-background);
    /* 🌟 أبيض */
    border-top: 1px solid var(--border-color);
    /* 🌟 حدود فاتحة */
    padding: 2rem 0 1rem;
    z-index: 999;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 1rem;
}

.footer-title {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
    padding-right: 0.5rem;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.social-link {
    color: var(--text-secondary);
}

.social-link:hover {
    color: var(--primary-color);
    transform: var(--hover-scale-small);
}

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    /* 🌟 حدود فاتحة */
    color: var(--text-secondary);
    font-size: 0.85rem;
}


/* ===== Admin Styles (وضوح لوحة التحكم) ===== */

.admin-container {
    max-width: 1200px;
    margin: 2rem auto;
}

.admin-nav {
    background: var(--card-background);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.admin-nav ul {
    list-style: none;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-nav a {
    padding: 0.5rem 1rem;
    background: var(--dark-accent);
    /* 🌟 خلفية فاتحة جداً */
    color: var(--primary-color);
    /* 🌟 نص أسود */
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.admin-nav a:hover {
    background: var(--primary-color);
    color: var(--white);
    /* 🌟 خلفية سوداء ونص أبيض عند التمرير */
    transform: scale(1.05);
}

.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    animation: slideInFromTop 0.5s ease-out;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert-info {
    background: rgba(33, 150, 243, 0.1);
    border: 1px solid #2196f3;
    color: #2196f3;
}


/* ===== Responsive Design (SMALLER, CLEARER ELEMENTS) - تم الحفاظ على الأكواد كما هي للـ Media Queries */

@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 60px;
        padding-bottom: 60px;
    }
    /* === Mobile Header Resizing === */
    .site-header {
        padding: 0.5rem 0;
    }
    .header-content {
        gap: 0.5rem;
        flex-wrap: nowrap;
    }
    .search-input {
        padding: 0.5rem 2.5rem 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
    .search-btn {
        left: 0.4rem;
        width: 24px;
        height: 24px;
    }
    .search-btn:hover {
        transform: translateY(-50%) scale(1.1);
    }
    .cart-icon-link {
        width: 38px;
        height: 38px;
        border-radius: 4px;
    }
    .cart-icon-link:hover {
        transform: scale(1.05);
    }
    .cart-icon {
        font-size: 1.1rem;
    }
    .cart-badge {
        width: 18px;
        height: 18px;
        font-size: 0.65rem;
        top: -4px;
        left: -4px;
    }
    .user-profile-container .btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
    .user-profile-container .user-name-text {
        display: none;
    }
    /* === Product Grid (FULL WIDTH AS REQUESTED) === */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .product-image {
        height: 220px;
    }
    .product-name {
        font-size: 1.1rem;
    }
    .product-price {
        font-size: 1.3rem;
    }
    .product-card .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    .product-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow);
    }
    /* === Typography === */
    h1 {
        font-size: 1.8rem;
    }
    h2 {
        font-size: 1.4rem;
    }
    h3 {
        font-size: 1.1rem;
    }
    /* === Footer/Navigation Toggles === */
    .site-footer {
        display: none;
    }
    .mobile-categories-nav {
        display: block;
    }
    /* === Tables (Stacked) === */
    .cart-table th:nth-child(5),
    .cart-table td:nth-child(5) {
        display: none;
    }
    .cart-table thead {
        display: none;
    }
    .cart-table tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        background: var(--card-background);
        padding: 0.8rem;
    }
    .cart-table td {
        display: block;
        padding: 0.4rem 0;
        border: none;
        border-bottom: 1px solid var(--border-color);
        text-align: right !important;
        /* 🌟 استخدام border-color */
        position: relative;
        padding-right: 35%;
    }
    .cart-table td:before {
        content: attr(data-label);
        position: absolute;
        right: 0;
        font-weight: 600;
        min-width: 100px;
        color: var(--secondary-color);
        font-size: 0.85rem;
    }
    /* === Grid Overrides === */
    .form-grid-2,
    .product-detail-grid,
    .checkout-grid,
    .order-info-grid {
        grid-template-columns: 1fr !important;
    }
    .invoice-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .admin-nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    .admin-nav a {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    .product-image {
        height: 180px;
    }
    .product-name {
        font-size: 1rem;
    }
    .product-price {
        font-size: 1.2rem;
    }
    .search-input {
        font-size: 0.8rem;
        padding: 0.4rem 2rem 0.4rem 0.6rem;
    }
    .search-btn {
        width: 20px;
        height: 20px;
        left: 0.3rem;
    }
    .search-icon {
        font-size: 0.8rem;
    }
    .cart-icon-link {
        width: 35px;
        height: 35px;
    }
    .cart-icon {
        font-size: 1rem;
    }
    .user-profile-container .btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    .page-title {
        font-size: 1.5rem;
        padding: 0.5rem 0;
    }
}


/* Extra small devices */

@media (max-width: 360px) {
    .container {
        padding: 0 10px;
    }
    .search-input {
        padding: 0.5rem 2rem 0.5rem 0.6rem;
        font-size: 0.85rem;
    }
    .product-image {
        height: 130px;
    }
}


/* ===== Additional Layouts (No Animation Changes) ===== */

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.order-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}


/* ===== Loading Animation (Existing spin, but now defined globally) ===== */

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    /* 🌟 تم تعديل الحدود لضمان الوضوح على الأبيض */
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}


/* 🌟 Keyframe for loading spin */

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* ===== Empty State (Added subtle animation) ===== */

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    animation: popIn 0.5s ease-out;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    80% {
        opacity: 1;
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}