/* ====================================================================
   الجسر العربي — Editorial Luxury Component System
   Storefront & Executive Control Center (Mobile-First & RTL)
   ==================================================================== */

/* 🔘 Luxury Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.92rem;
    min-height: var(--mobile-tap-target);
    transition: all var(--transition-normal);
    position: relative;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background: var(--color-bg-dark);
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(20, 20, 22, 0.15);
}

.btn-primary:hover {
    background: #232328;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(20, 20, 22, 0.22);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-gold {
    background: var(--color-gold-gradient);
    color: #141416;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(184, 154, 90, 0.28);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(184, 154, 90, 0.40);
}

.btn-secondary {
    background: var(--color-bg-subtle);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border-subtle);
}

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

.btn-outline {
    background: transparent;
    color: var(--color-text-primary);
    border: 1px solid var(--color-border-medium);
}

.btn-outline:hover {
    border-color: var(--color-bg-dark);
    background: rgba(20, 20, 22, 0.04);
}

.btn-outline-gold {
    background: transparent;
    color: var(--color-gold-primary);
    border: 1px solid var(--color-gold-primary);
}

.btn-outline-gold:hover {
    background: var(--color-gold-subtle);
    border-color: var(--color-gold-dark);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.82rem;
    min-height: 38px;
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1.02rem;
    min-height: 52px;
}

.btn-icon {
    width: var(--mobile-tap-target);
    height: var(--mobile-tap-target);
    padding: 0;
    border-radius: var(--radius-full);
}

/* 🏷️ Badges & Tags */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.badge-gold {
    background: #F8F4EA;
    color: var(--color-gold-dark);
    border: 1px solid var(--color-gold-border);
}

.badge-dark {
    background: var(--color-bg-dark);
    color: #FFFFFF;
}

.badge-discount {
    background: #991B1B;
    color: #FFFFFF;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge-stock {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.badge-low-stock {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.badge-out-stock {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

/* 🃏 Surface Cards */
.card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-normal);
}

.card-interactive {
    cursor: pointer;
}

.card-interactive:hover {
    border-color: var(--color-border-medium);
    transform: translateY(-3px);
    box-shadow: var(--shadow-card-hover);
}

.card-dark {
    background: var(--color-bg-dark);
    color: #FFFFFF;
    border: 1px solid var(--color-border-dark);
}

/* 🛍️ Editorial Product Card */
.product-card {
    background: var(--color-bg-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all var(--transition-normal);
    border: 1px solid transparent;
}

.product-card:hover {
    border-color: var(--color-border-subtle);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.product-card-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    background: var(--color-bg-subtle);
    overflow: hidden;
}

.product-card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .product-card-img-wrapper img {
    transform: scale(1.06);
}

.product-card-badges {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
}

.product-card-wishlist {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(8px);
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.product-card-wishlist:hover,
.product-card-wishlist.active {
    color: #EF4444;
    background: #FFFFFF;
    transform: scale(1.1);
}

.product-card-wishlist.active svg {
    fill: #EF4444;
    stroke: #EF4444;
}


.product-card-content {
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 8px;
}

.product-card-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    font-weight: 500;
}

.product-card-title {
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--color-text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-pricing {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
}

.product-card-price {
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.01em;
}

.product-card-old-price {
    font-size: 0.88rem;
    color: var(--color-text-muted);
    text-decoration: line-through;
}

/* 📝 Forms & Inputs */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.form-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-medium);
    color: var(--color-text-primary);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    min-height: var(--mobile-tap-target);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--color-gold-primary);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(184, 154, 90, 0.15);
}

.form-error {
    font-size: 0.8rem;
    color: var(--color-danger);
}

/* 📱 Bottom Navigation (Mobile Only) */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    height: var(--bottom-nav-height);
    background: var(--color-bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--color-border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);
}

@media (min-width: 768px) {
    .mobile-bottom-nav {
        display: none;
    }
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--color-text-muted);
    font-size: 0.72rem;
    font-weight: 500;
    flex: 1;
    height: 100%;
    position: relative;
    transition: color var(--transition-fast);
}

.bottom-nav-item.active {
    color: var(--color-text-primary);
    font-weight: 700;
}

.bottom-nav-item svg {
    width: 22px;
    height: 22px;
    transition: transform var(--transition-fast);
}

.bottom-nav-item.active svg {
    transform: scale(1.1);
    stroke: var(--color-gold-primary);
}

.bottom-nav-badge {
    position: absolute;
    top: 8px;
    left: calc(50% + 6px);
    background: var(--color-gold-primary);
    color: #FFFFFF;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 🪟 Bootstrap & Luxury Offcanvas Drawer */
.offcanvas {
    position: fixed !important;
    bottom: 0 !important;
    top: 0 !important;
    z-index: 1050 !important;
    display: flex !important;
    flex-direction: column !important;
    max-width: 100% !important;
    visibility: hidden !important;
    background-color: #FFFFFF !important;
    color: #141416 !important;
    outline: 0 !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
}

.offcanvas.offcanvas-start {
    right: 0 !important;
    left: auto !important;
    width: 320px !important;
    max-width: 85vw !important;
    transform: translateX(100%) !important;
    border-left: 1px solid var(--color-border-subtle) !important;
}

.offcanvas.offcanvas-bottom {
    top: auto !important;
    right: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-height: 85vh !important;
    transform: translateY(100%) !important;
    border-top: 1px solid var(--color-border-subtle) !important;
    border-top-left-radius: var(--radius-xl) !important;
    border-top-right-radius: var(--radius-xl) !important;
}

.offcanvas.show {
    visibility: visible !important;
    transform: none !important;
}

.offcanvas.showing {
    visibility: visible !important;
}

.offcanvas.hiding {
    visibility: hidden !important;
}

.offcanvas-backdrop {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(20, 20, 22, 0.6) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 1040 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
}

.offcanvas-backdrop.show {
    opacity: 1 !important;
    visibility: visible !important;
}

/* 🪟 Bottom Sheet & Modal */
.bottom-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 22, 0.55);
    backdrop-filter: blur(4px);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

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

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 88vh;
    background: var(--color-bg-surface);
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
    z-index: 201;
    transform: translateY(100%);
    transition: transform var(--transition-smooth);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-floating);
}

.bottom-sheet.active {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 44px;
    height: 4px;
    background: var(--color-border-medium);
    border-radius: var(--radius-full);
    margin: 12px auto 6px;
}

.bottom-sheet-header {
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-border-subtle);
}

.bottom-sheet-body {
    padding: 24px;
    overflow-y: auto;
}

/* 🍞 Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    max-width: 420px;
    margin-inline: auto;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--color-bg-dark);
    color: #FFFFFF;
    border: 1px solid var(--color-border-dark);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    animation: toastSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-success {
    border-left: 4px solid var(--color-success);
}

.toast-error {
    border-left: 4px solid var(--color-danger);
}

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

/* 📊 Progress Bar */
.progress-bar-container {
    background: var(--color-bg-subtle);
    border-radius: var(--radius-full);
    height: 8px;
    overflow: hidden;
    width: 100%;
}

.progress-bar-fill {
    height: 100%;
    background: var(--color-gold-gradient);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

/* 🏛️ Executive Admin Layout & Controls */
.admin-shell {
    display: flex;
    min-height: 100vh;
    background: var(--color-bg-main);
}

.admin-sidebar {
    width: 260px;
    background: var(--color-bg-dark);
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform var(--transition-smooth);
    z-index: 90;
}

.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--color-bg-main);
}

.admin-topbar {
    height: 70px;
    background: var(--color-bg-surface);
    border-bottom: 1px solid var(--color-border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-inline: 24px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    color: #A09D98;
    border-radius: var(--radius-md);
    margin-inline: 12px;
    margin-block: 2px;
    font-size: 0.92rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.admin-nav-item:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.06);
}

.admin-nav-item.active {
    color: #FFFFFF;
    background: rgba(184, 154, 90, 0.15);
    border-inline-start: 3px solid var(--color-gold-primary);
}

/* 📊 Data Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
}

.table-luxury {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: right;
}

.table-luxury th {
    padding: 16px 20px;
    background: var(--color-bg-subtle);
    color: var(--color-text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--color-border-subtle);
}

.table-luxury td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border-subtle);
    color: var(--color-text-primary);
    font-size: 0.92rem;
    vertical-align: middle;
}

.table-luxury tr:last-child td {
    border-bottom: none;
}

.table-luxury tr:hover td {
    background: var(--color-bg-subtle);
}

/* 🏷️ Admin Status Pills */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
}

.status-pill-pending { background: #FEF3C7; color: #92400E; }
.status-pill-confirmed { background: #DBEAFE; color: #1E40AF; }
.status-pill-shipped { background: #E0E7FF; color: #3730A3; }
.status-pill-delivered { background: #DCFCE7; color: #166534; }
.status-pill-cancelled { background: #FEE2E2; color: #991B1B; }
.status-pill-paid { background: #DCFCE7; color: #166534; }
.status-pill-unpaid { background: #FEF3C7; color: #92400E; }
