/* ملف الأنماط الخاص بمتجر صافكا */

:root {
    --primary-color: #6D28D9;
    --primary-hover: #5B21B6;
    --secondary-color: #A78BFA;
    --dark-color: #1E2A44;
    --light-color: #F5F3FF;
    --gray-color: #eeeeee;
    --warning-color: #F5B301;
    --gold-color: #F5B301;
}

body {
    font-family: 'Tajawal', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
    color: var(--dark-color);
}

main {
    flex: 1 0 auto;
    padding-bottom: 2rem;
}

/* أنماط الرأس */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.navbar.navbar-glass {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, 0.78) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    transition: background 220ms ease, box-shadow 220ms ease, border-color 220ms ease, backdrop-filter 220ms ease;
}

.navbar.navbar-glass.is-scrolled {
    background: rgba(255, 255, 255, 0.92) !important;
    border-bottom-color: rgba(15, 23, 42, 0.10);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.10);
}

.navbar.navbar-glass.is-scrolled::after {
    background:
        radial-gradient(650px 120px at 20% 0%, rgba(109, 40, 217, 0.07), transparent 55%),
        radial-gradient(420px 120px at 80% 0%, rgba(245, 179, 1, 0.09), transparent 55%);
}

.navbar.navbar-glass::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(650px 120px at 20% 0%, rgba(109, 40, 217, 0.10), transparent 55%),
        radial-gradient(420px 120px at 80% 0%, rgba(245, 179, 1, 0.12), transparent 55%);
}

.navbar.navbar-glass > .container {
    position: relative;
    z-index: 1;
}

.navbar .navbar-nav {
    gap: 10px;
}

.navbar .nav-link {
    padding-left: 10px;
    padding-right: 10px;
}

.navbar .d-flex.align-items-center {
    gap: 10px;
}

.navbar form.d-flex {
    gap: 8px;
}

.navbar .search-input {
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: rgba(255,255,255,0.88);
    padding-inline: 14px;
    min-width: 240px;
    transition: box-shadow 180ms ease, border-color 180ms ease;
}

.navbar .search-input:focus {
    border-color: rgba(109, 40, 217, 0.35);
    box-shadow: 0 0 0 0.22rem rgba(109, 40, 217, 0.14);
}

.navbar .search-btn {
    border-radius: 999px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(109, 40, 217, 0.22);
}

.navbar .form-select {
    min-width: 96px;
}

.navbar .nav-currency {
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: rgba(255,255,255,0.88);
}

.navbar .nav-icon-btn {
    border-radius: 12px;
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 22px rgba(109, 40, 217, 0.20);
}

.navbar .nav-icon-btn i {
    font-size: 1.1rem;
}

@media (min-width: 992px) {
    .navbar .navbar-nav {
        gap: 14px;
    }

    .navbar .d-flex.align-items-center {
        gap: 12px;
    }

    .navbar form.d-flex {
        min-width: 340px;
    }
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--dark-color) !important;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.navbar-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.navbar-brand .brand-text {
    color: var(--dark-color);
    letter-spacing: 0.2px;
}

.navbar-brand .brand-text::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--gold-color);
    border-radius: 999px;
    margin-right: 6px;
    position: relative;
    top: -2px;
}

.navbar-light {
    background-color: white !important;
}

.nav-link {
    font-weight: 500;
    position: relative;
}

.navbar.navbar-glass .nav-link {
    border-radius: 999px;
    padding: 8px 12px;
    transition: background 160ms ease, color 160ms ease;
}

.navbar.navbar-glass .nav-link:hover {
    background: rgba(109, 40, 217, 0.08);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
}

.navbar.navbar-glass .nav-link.active::after {
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary-color), var(--gold-color));
}

/* Hero Section */
.hero-section {
    background: transparent;
    border: none;
    box-shadow: none;
}

.hero-content {
    background:
        radial-gradient(900px 420px at 20% 10%, rgba(109, 40, 217, 0.10), transparent 55%),
        radial-gradient(650px 320px at 85% 0%, rgba(245, 179, 1, 0.12), transparent 55%),
        linear-gradient(180deg, rgba(245, 243, 255, 0.95), rgba(255, 255, 255, 0.92));
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.80);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: rgba(30, 42, 68, 0.85);
    font-weight: 600;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.hero-title {
    font-weight: 800;
    letter-spacing: 0.2px;
    font-size: clamp(2rem, 4vw, 3.1rem);
    line-height: 1.15;
    margin-bottom: 0.75rem;
    color: var(--dark-color);
}

.hero-brand {
    background: linear-gradient(90deg, var(--primary-color), var(--gold-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    position: relative;
    white-space: nowrap;
    line-height: 1.15;
    min-height: 1.15em;
    padding-inline-end: 0.6ch;
}

.hero-brand:empty::before {
    content: "\00a0";
}

.hero-brand.typing-caret::after {
    content: '|';
    color: var(--primary-color);
    animation: caretBlink 0.7s step-end infinite;
    position: absolute;
    inset-inline-end: -0.4ch;
    top: 0;
}

@keyframes caretBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-subtitle {
    font-size: 1.05rem;
    line-height: 1.85;
    color: rgba(30, 42, 68, 0.78);
    max-width: 42ch;
}

.hero-actions .btn {
    border-radius: 14px;
}

.hero-actions .btn-primary {
    box-shadow: 0 14px 26px rgba(109, 40, 217, 0.25);
}

.back-to-top {
    position: fixed;
    bottom: 18px;
    left: 18px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: none;
    background-color: var(--primary-color);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
    z-index: 1050;
    transition: transform 160ms ease, opacity 160ms ease;
}

.back-to-top:hover {
    transform: translateY(-2px);
}

.img-skeleton {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, #eee, #f6f6f6, #eee);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.2s ease-in-out infinite;
}

.img-skeleton.is-loaded {
    animation: none;
    background: transparent;
}

.img-skeleton .skeleton-target {
    display: block;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 180ms ease;
}

.img-skeleton.is-loaded .skeleton-target {
    opacity: 1;
}

.img-skeleton-card {
    height: 420px;
}

.img-skeleton-cart {
    width: 100%;
    max-width: 100px;
    max-height: 100px;
    border-radius: 10px;
}

.img-skeleton-product {
    border-radius: 10px;
}

.product-image-zoom {
    cursor: zoom-in;
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* أنماط بطاقات المنتجات */
.product-card {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 16px;
    overflow: hidden;
    border: none;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    background-color: white;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

.product-card .card-img-top {
    height: 420px;
    object-fit: cover;
    background: #f8f8fb;
    padding: 0;
    transition: transform 0.5s ease;
}

.product-card:hover .card-img-top {
    transform: scale(1.06);
}

.product-discount-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    background: #dc3545;
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 6px 10px;
    border-radius: 8px;
    box-shadow: 0 10px 22px rgba(220, 53, 69, 0.25);
}

.product-card .card-body {
    padding: 1rem 1rem 1.1rem;
}

.product-card .card-title {
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--dark-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    line-height: 1.35;
    min-height: calc(1.35em * 2);
}

.product-card .card-text {
    margin-bottom: 1rem;
    color: #777;
    font-size: 0.9rem;
    line-height: 1.5;
}

.product-card .price {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 0;
    display: flex;
    align-items: center;
}

.special-offers-banner {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(0,0,0,0.10);
    background: #f8f8fb;
}

.special-offers-link {
    display: block;
    position: relative;
    text-decoration: none;
}

.special-offers-img {
    width: 100%;
    height: 400px;
    object-fit: contain;
    display: block;
    background: #f8f8fb;
    border-radius: 16px;
}

.special-offers-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0.55), rgba(0,0,0,0.10) 55%, rgba(0,0,0,0));
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 24px;
}

.special-offers-title {
    color: #fff;
    font-weight: 800;
    font-size: 2rem;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(109, 40, 217, 0.85);
    backdrop-filter: blur(4px);
}

.product-card .price::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    margin-left: 5px;
}

.product-card .btn-add-to-cart {
    background-color: var(--primary-color);
    border: none;
    color: white;
    transition: all 0.3s ease;
    padding: 8px 10px;
    position: relative;
    z-index: 2;
}

.product-card .btn-add-to-cart:not(.rounded-circle) {
    border-radius: 8px;
}

.product-card .btn-add-to-cart:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 8px 18px rgba(109, 40, 217, 0.35);
}

/* أنماط صفحة المنتج */
.product-image {
    max-height: 500px;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.product-title {
    font-size: 2rem;
    font-weight: 700;
}

.product-category {
    background-color: #e9ecef;
    padding: 5px 10px;
    border-radius: 20px;
    color: #495057;
    font-size: 0.9rem;
}

.product-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: #dc3545;
}

/* أنماط سلة التسوق */
.cart-item {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
}

.cart-item-image {
    max-width: 100px;
    max-height: 100px;
    object-fit: contain;
}

.cart-summary {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.cart-summary-title {
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-weight: 600;
}

/* أنماط نموذج التسجيل */
.form-control:focus {
    border-color: #764ba2;
    box-shadow: 0 0 0 0.25rem rgba(118, 75, 162, 0.25);
}

.btn-primary {
    background-color: #764ba2;
    border-color: #764ba2;
}

.btn-primary:hover {
    background-color: #5d3b82;
    border-color: #5d3b82;
}

/* أنماط صفحة تتبع الطلب */
.order-tracking-section {
    max-width: 800px;
    margin: 0 auto;
}

.tracking-step {
    position: relative;
    padding-bottom: 30px;
}

.tracking-step::before {
    content: '';
    position: absolute;
    height: 100%;
    width: 2px;
    background-color: #ddd;
    right: 19px;
    top: 0;
    z-index: 0;
}

.tracking-step:last-child::before {
    display: none;
}

.tracking-step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f8f9fa;
    border: 2px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.tracking-step.active .tracking-step-icon {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.tracking-step-content {
    padding-right: 60px;
    position: relative;
    top: -40px;
    margin-bottom: -20px;
}

.tracking-step-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.tracking-step-date {
    color: #6c757d;
    font-size: 0.9rem;
}

/* أنماط التذييل */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding-top: 3rem;
    margin-top: 2rem;
}

.footer.bg-light {
    background-color: #ffffff !important;
    color: var(--dark-color) !important;
}

.footer h5 {
    font-weight: 700;
    margin-bottom: 1.2rem;
    color: white;
    position: relative;
    padding-bottom: 0.8rem;
}

.footer.bg-light h5 {
    color: var(--primary-color) !important;
}

.footer h5:after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
}

.footer a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease;
}

.footer.bg-light a {
    color: var(--dark-color) !important;
}

.footer.bg-light a:hover {
    color: var(--primary-color) !important;
}

.footer.bg-light .text-muted {
    color: #4b5563 !important;
}

.footer a:hover {
    color: var(--primary-color);
}

.footer .d-flex.gap-3 a {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.footer .d-flex.gap-3 a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

/* أنماط الأزرار */
.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white;
    border-radius: 8px;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    box-shadow: 0 5px 15px rgba(109, 40, 217, 0.35);
    transform: translateY(-2px);
}

.btn-outline-primary {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    border-radius: 8px;
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.btn-secondary {
    background-color: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
}

/* أنماط عامة */
.badge-status {
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 20px;
}

.badge-pending {
    background-color: var(--warning-color);
    color: #212529;
}

.badge-processing {
    background-color: var(--secondary-color);
    color: white;
}

.badge-received {
    background-color: #0ea5e9 !important;
    color: white !important;
}

.badge-shipped {
    background-color: #4dabf7;
    color: white;
}

.badge-delivered {
    background-color: #40c057;
    color: white;
}

.badge-cancelled {
    background-color: var(--primary-color);
    color: white;
}

/* العناوين الرئيسية */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
}

.page-title {
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 25px;
}

.page-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 70px;
    height: 3px;
    background-color: var(--primary-color);
}

/* القوائم وأشرطة التنقل */
.list-group-item.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* صندوق البحث */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(109, 40, 217, 0.18);
}

/* Bootstrap overrides للبنفسجي */
.bg-primary { background-color: var(--primary-color) !important; }
.text-primary { color: var(--primary-color) !important; }
.border-primary { border-color: var(--primary-color) !important; }
.bg-secondary { background-color: var(--secondary-color) !important; }
.text-secondary { color: var(--secondary-color) !important; }

/* ===== Animations ===== */

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 500ms ease, transform 500ms ease;
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Badge Pop Animation */
@keyframes pop {
    0% { transform: scale(1); }
    35% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

.badge-pop {
    animation: pop 280ms ease;
}

/* Cart Bounce Animation */
@keyframes cartBounce {
    0% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
    60% { transform: translateY(0); }
    100% { transform: translateY(0); }
}

.cart-bounce {
    animation: cartBounce 350ms ease;
}

/* احترام إعدادات المستخدم لتقليل الحركة */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* تخفيف hover على الأجهزة اللمسية */
@media (hover: none) {
    .product-card:hover {
        transform: none;
        box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    }
    .product-card:hover .card-img-top {
        transform: none;
    }
}

/* التصميم المتجاوب للشاشات الصغيرة */
@media (max-width: 767.98px) {
    .hero-title {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }

    .hero-title-prefix {
        display: block;
    }

    .hero-brand {
        min-width: 7ch;
    }

    .special-offers-banner {
        background: #f8f8fb;
        border-radius: 16px;
        overflow: hidden;
    }

    .special-offers-img {
        height: 400px;
        object-fit: contain;
        background: #f8f8fb;
        border-radius: 16px;
    }

    .special-offers-overlay {
        padding: 14px;
    }

    .special-offers-title {
        font-size: 1.25rem;
        padding: 8px 12px;
        border-radius: 12px;
    }

    .product-discount-badge {
        top: 10px;
        left: 10px;
        font-size: 0.8rem;
        padding: 5px 8px;
        border-radius: 8px;
    }

    .navbar .navbar-toggler {
        margin-inline-end: 10px;
    }

    .navbar .navbar-mobile-actions {
        gap: 10px !important;
    }

    .navbar .nav-currency {
        min-width: 86px;
    }

    .product-card .card-img-top {
        height: 200px;
        object-fit: contain;
        background: #f8f8fb;
        padding: 8px;
    }

    .img-skeleton-card {
        height: 200px;
    }
    
    .product-image {
        max-height: 300px;
    }
    
    .product-title {
        font-size: 1.5rem;
    }
    
    .product-price {
        font-size: 1.5rem;
    }
}
