

/* ===== Reset خفيف ===== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
img, video { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

/* ===== ألوان ومتغيرات ===== */
:root {
  --bg: #0f1220;          /* خلفية داكنة مريحة */
  --surface: #151933;     /* طبقة بطاقات */
  --text: #f4f6ff;        /* نص أساسي */
  --muted: #aab2d5;       /* نص ثانوي */
  --primary: #ffc107;     /* أكسنت */
  --primary-ink: #2b2b2b;
  --border: #242949;
  --success: #16a34a;
  --error: #ef4444;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(0,0,0,.24);
}

body { background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Cairo, Arial, sans-serif; line-height: 1.7; }

/* ===== حاوية ومساعدات ===== */
.container { width: min(1100px, 92%); margin-inline: auto; }
.row { display: flex; flex-wrap: wrap; }
.jc-between { justify-content: space-between; }
.jc-center { justify-content: center; }
.ai-center { align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.py-12 { padding-block: 12px; } .py-24 { padding-block: 24px; }
.min-h-screen { min-height: 100vh; }
.bg-body { background: var(--bg); } .text-body { color: var(--text); }
.muted { color: var(--muted); }
.accent { color: var(--primary); }

/* ===== ترويسة/فوتر ===== */
.header { position: sticky; top: 0; z-index: 50; background: rgba(15,18,32,.7); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); }
.logo { font-weight: 800; font-size: 1.1rem; letter-spacing: .3px; }
.footer { border-top: 1px solid var(--border); background: #0d1020; }

/* ===== ناڤ موبايل ===== */
.hamburger { display: none; background: transparent; border: 1px solid var(--border); padding: 10px 12px; border-radius: calc(var(--radius) - 8px); color: var(--text); z-index:2}
.nav { }
.nav-list { display: flex; gap: 12px; align-items: center;}
.nav-link { padding: 10px 14px; border-radius: 10px; border: 1px solid transparent; }
.nav-link:hover { border-color: var(--border); background: #11142a; }
.nav-link.active { background: var(--surface); border-color: var(--border); }

@media (max-width: 960px) {
  .hamburger { display: inline-block; }
  .nav { position: fixed; inset-inline: 0; top: 0px; background: #0c0f1e; border-top: 1px solid var(--border); transform: translateY(-120%); transition: transform .25s ease; }
  .nav.open { transform: translateY(0); }
  .nav-list { flex-direction: column; padding: 12px; }
}

/* ===== أزرار ونماذج ===== */
.btn { background: var(--primary); color: var(--primary-ink); padding: 10px 16px; border-radius: 12px; border: none; font-weight: 700; box-shadow: var(--shadow); }
.btn:hover { filter: brightness(.95); }
.btn-ghost { background: transparent; color: var(--text); padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); }

.input, .select, .textarea { width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.label { display: inline-block; margin-bottom: 6px; color: var(--muted); font-size: .95rem; }

/* ===== بطاقات وقوائم ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 960px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }

/* ===== تنبيهات ===== */
.alert { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: #101531; margin-bottom: 16px; }
.alert.success { border-color: #14532d; background: #0b2b1a; color: #bff0c9; }
.alert.error { border-color: #7f1d1d; background: #2a0e0e; color: #fecaca; }

/* ===== فيديو مستجيب ===== */
.video-wrap { position: relative; width: 100%; padding-top: 56.25%; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #000; }
.video-wrap > iframe, .video-wrap > video { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ===== عناصر وصول ===== */
.skip { position: absolute; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip:focus { position: static; width: auto; height: auto; background: #11142a; padding: 6px 10px; border-radius: 8px; }

/* تمرير أفقي للكروت المصغّرة */
.h-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.h-scroll::-webkit-scrollbar { height: 6px; }
.h-scroll::-webkit-scrollbar-thumb { background: #22284a; border-radius: 10px; }

/* بطاقات مدمجة لقائمة الهيرو */
.card-inline { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: start; }
.title-6 { font-size: 1rem; font-weight: 700; }
.stack { display: grid; gap: 8px; }

/* صور مصغّرة ونِسَب */
.thumb { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #0a0d1d; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-sm { width: 96px; height: 64px; }
.ratio-16x9 { position: relative; padding-top: 56.25%; }
.ratio-16x9 > img, .ratio-16x9 > iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

/* شارات وأسعار ونصوص مقصوصة */
.badge { display: inline-block; background: #111536; border: 1px solid var(--border); color: var(--text); padding: 6px 10px; border-radius: 999px; font-size: .9rem; }
.chip { background: #111536; border: 1px solid var(--border); padding: 4px 8px; border-radius: 999px; font-size: .85rem; color: var(--muted); }
.price { display: flex; gap: 8px; align-items: baseline; }
.price .now { font-weight: 800; }
.price .was { color: var(--muted); text-decoration: line-through; font-size: .9rem; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }


/* Modal Container */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: block;
}

/* Modal Content */
.modal-content {
    background-color: #fff;
    margin: 50px auto;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s;
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

.close {
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover,
.close:focus {
    color: #000;
}

/* Modal Body */
.modal-body {
    padding: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #4CAF50;
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.info-box {
    background-color: #e3f2fd;
    color: #1976d2;
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
    margin-top: 10px;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    background-color: #f5f5f5;
    border-radius: 0 0 8px 8px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-cancel {
    background-color: #f0f0f0;
    color: #666;
}

.btn-cancel:hover {
    background-color: #e0e0e0;
}

.btn-submit {
    background-color: #4CAF50;
    color: white;
    position: relative;
}

.btn-submit:hover {
    background-color: #45a049;
}

.btn-submit:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Spinners */
.spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 5px;
    vertical-align: middle;
}

.spinner.show {
    display: inline-block;
}

/* Report Button */
.report-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #ff9800;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
    z-index: 1000;
}

.report-btn:hover {
    background-color: #f57c00;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

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

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        margin: 20px auto;
    }
    
    .report-btn {
        bottom: 10px;
        right: 10px;
        padding: 10px 15px;
        font-size: 14px;
    }
}
/* Existing styles */
#branch-cta button {
    border-radius: 10px;
    width: 80%;
    margin: auto;
    margin-top: 10px;
}

/* Quick Buy Modal */
#quickBuyModal {
    height: max-content;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

#quickBuyBackdrop {
    backdrop-filter: blur(4px);
}

/* Form styles */
#quickPurchaseForm {
    padding: 20px;
}

#quickPurchaseForm .input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#quickPurchaseForm .input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

#quickPurchaseForm .label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text);
}

#quickPurchaseForm small {
    display: block;
    margin-top: 4px;
    font-size: 13px;
}

/* Loading spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#quickBuyLoading p {
    color: var(--text);
    font-size: 16px;
}

/* Divider */
.divider {
    text-align: center;
    position: relative;
    color: var(--muted);
    margin: 20px 0;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 42%;
    height: 1px;
    background: var(--border);
}

.divider::before { left: 0; }
.divider::after { right: 0; }

/* Buttons */
#quickBuySubmit {
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
}

#quickBuySubmit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.buyNowOpenMobile {
    cursor: pointer;
    transition: all 0.3s;
}

.buyNowOpenMobile:hover {
    transform: scale(1.05);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    #quickBuyModal {
        max-width: 95%;
        margin: auto 2.5%;
    }
    
    #quickPurchaseForm {
        padding: 15px;
    }
}

/* Animation for modal appearance */
#quickBuyModal {
    animation: slideUp 0.3s ease-out;
}

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

/* Report Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-content {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
    direction: rtl;
    text-align: right;
}

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

.modal-header {
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.close {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 28px;
    font-weight: bold;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover,
.close:focus {
    color: #374151;
    background-color: #f3f4f6;
    transform: translateY(-50%) scale(1.1);
}

.modal-body {
    padding: 24px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.2s ease;
    background-color: #ffffff;
    box-sizing: border-box;
    direction: rtl;
    text-align: right;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background-color: #fefefe;
}

.form-input:invalid {
    border-color: #ef4444;
}

.form-input:invalid:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5;
}

.info-box {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 16px;
    font-size: 14px;
    color: #1e40af;
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.4;
}

.modal-footer {
    padding: 16px 24px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    border-top: 1px solid #e5e7eb;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-sizing: border-box;
}

.btn-cancel {
    background-color: #f3f4f6;
    color: #374151;
    border-color: #d1d5db;
}

.btn-cancel:hover {
    background-color: #e5e7eb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.btn-submit {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.btn-submit:hover {
    background-color: #2563eb;
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-submit:disabled {
    background-color: #9ca3af;
    border-color: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading spinner */
#spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

#spinner:not(.loading) {
    display: none;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px;
        max-height: calc(100vh - 40px);
    }
    
    .modal-header {
        padding: 20px 20px 16px 20px;
    }
    
    .modal-header h2 {
        font-size: 20px;
    }
    
    .close {
        left: 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 16px 20px 20px 20px;
        flex-direction: column-reverse;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .modal {
        padding: 0;
    }
}