/* Common CSS for both mobile and desktop */

/* Form styling */
.form-layout {
    border-radius: 20px;
    width: 500px;
}

/* Message timer */
#message-timer {
    margin-top: 10px;
    margin-bottom: 10px;
}

/* Global Messages Styling */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.alert i {
    font-size: 1.1em;
}

/* Site-wide promotion banner */
.site-promo-banner {
    background-color: #111;
    color: #fff;
    font-size: 0.85rem;
    padding: 0.25rem 0;
    text-align: center;
}

.site-promo-banner.promo-anim-slide-up {
    transition: opacity 0.35s ease, transform 0.35s ease;
    transform: translateY(0);
}

.site-promo-banner.promo-anim-slide-up.is-fading {
    opacity: 0;
    transform: translateY(6px);
}

.site-promo-banner .container-fluid {
    display: block;
    text-align: center;
    padding-left: 1rem;
    padding-right: 1rem;
}

.site-promo-banner .promo-title,
.site-promo-banner .promo-sub,
.site-promo-banner .promo-cta,
.site-promo-banner .promo-sep {
    display: inline-block;
    margin: 0 0.08rem;
}

.site-promo-banner .promo-title {
    font-weight: 600;
    letter-spacing: 0.01em;
}

.site-promo-banner .promo-sub {
    opacity: 0.85;
}

.site-promo-banner .promo-cta {
    color: #fff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 0.2rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: inherit;
}

.site-promo-banner .promo-cta:hover {
    color: #fff;
    border-color: #fff;
}

.site-promo-banner .promo-cta.promo-cta-disabled {
    cursor: text;
    pointer-events: auto;
    opacity: 0.9;
    user-select: text;
}

/* Common button styles */
.btn {
    /* No transitions or transforms */
}

.btn:hover {
    /* No hover effects */
}

/* Common link styles */
a {
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    text-decoration: none;
}

/* Site-wide font — matches the Raleway heading treatment used on the
   category/wishlist hero titles across the rest of the storefront. */
body.site-body {
    font-family: 'Raleway', sans-serif;
}

/* Site footer */
body.site-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
}

body.site-body main {
    background-color: #ffffff;
    padding-bottom: 1.5rem;
}

body.site-body .category-page .sticky-filter-sidebar,
body.site-body .category-page .sticky-filter-sidebar .card-body,
body.site-body .category-page .sticky-filter-sidebar .card-header,
body.site-body .category-page .product-card,
body.site-body .category-page .product-card-list,
body.site-body .category-page .products-list .product-card-list {
    background-color: #ffffff !important;
}

body.site-body .product-page .card,
body.site-body .product-page .product-detail-card,
body.site-body .cart-page .card,
body.site-body .cart-page .order-summary,
body.site-body .wishlist-page .product-card,
body.site-body .wishlist-page .product-card-list {
    background-color: #ffffff !important;
}

body.site-body .wishlist-page .wishlist-summary-bar {
    background-color: #ffffff;
}

body.site-body .wishlist-page .wishlist-icon {
    background-color: #ffffff !important;
}

body.site-body .wishlist-page .product-card .image-container {
    background-color: #ffffff !important;
}

body.site-body .cart-page .cart-summary-header {
    background-color: #ffffff;
}

body.site-body .cart-page .cart-image-placeholder {
    background-color: #ffffff;
}

body.site-body .product-page .col-md-6.col-lg-6 .d-flex.flex-column.align-items-center,
body.site-body .product-page .col-md-6.col-lg-6:nth-child(2) {
    background-color: #ffffff !important;
}

body.site-body .product-page .form-control,
body.site-body .product-page .form-select,
body.site-body .product-page .input-group-text {
    background-color: #ffffff !important;
}

body.site-body .cart-page .form-control,
body.site-body .cart-page .form-select,
body.site-body .cart-page .input-group-text {
    background-color: #ffffff !important;
}

/* Checkout page creamy theme */
body.site-body .checkout-container .card,
body.site-body .checkout-container .card-body,
body.site-body .checkout-container .list-group-item,
body.site-body .checkout-container .modal-content,
body.site-body .checkout-container .modal-body,
body.site-body .checkout-container .modal-footer {
    background-color: #ffffff !important;
}

/* Strong Arabic typography guard for any page that explicitly sets lang-ar on body. */
body.lang-ar,
body.lang-ar * {
    font-family: Tahoma, Arial, "Geeza Pro", "Noto Naskh Arabic", "Noto Sans Arabic", sans-serif !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

/* Preserve Font Awesome icon fonts in Arabic UI. */
body.lang-ar .fa,
body.lang-ar .fas,
body.lang-ar .far,
body.lang-ar .fal,
body.lang-ar .fad {
    font-family: "Font Awesome 5 Free" !important;
}

body.lang-ar .fab {
    font-family: "Font Awesome 5 Brands" !important;
}

.site-footer {
    background-color: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding: 1.1rem 0 1.6rem;
    margin-top: auto;
}

.site-footer .container {
    display: block;
}

.footer-brand {
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #111;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
}

.footer-links a {
    color: #4a5568;
    text-decoration: none;
}

.footer-links a:hover {
    color: #111;
    text-decoration: none;
    padding-left: 4px;
    transition: all 0.2s ease;
}

.site-footer h6 {
    letter-spacing: 0.08em;
    color: #111;
    font-weight: 600;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.site-footer .row {
    margin-bottom: 0;
}

.site-footer .border-top {
    border-color: #e5e7eb !important;
}

.back-to-top-fab {
    position: fixed;
    left: 1rem;
    bottom: calc(2.2rem + var(--sticky-bottom-offset, 0px));
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 9999;
}

.back-to-top-fab:hover {
    color: #fff;
    transform: translateY(0);
}

.back-to-top-fab.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top-fab.sync-with-sticky {
    transition: none;
}

body.modal-open .back-to-top-fab {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(6px);
}

.footer-social {
    display: flex;
    gap: 0.75rem;
}

.footer-social a {
    color: #111;
    font-size: 0.95rem;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e5e7eb;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.footer-social img {
    height: 22px;
    width: 22px;
    display: block;
    object-fit: contain;
}

.footer-social a:hover {
    border-color: #cbd5e0;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.site-footer .form-control,
.site-footer .form-select {
    background-color: #fff;
}

.site-footer .btn-primary {
    box-shadow: none;
}

.seller-name-emphasis {
    color: #111827;
    font-weight: 600;
}

.seller-name-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.seller-name-link:hover {
    color: inherit;
    text-decoration-style: solid;
}

.footer-subscribe {
    flex-wrap: wrap;
}

.footer-subscribe .form-control {
    min-width: 180px;
    flex: 1 1 200px;
}

.footer-subscribe .btn {
    white-space: nowrap;
}

.footer-payment-icon,
.footer-shipping-icon {
    height: 28px;
    width: auto;
    display: block;
    object-fit: contain;
}

@media (max-width: 1279px) {
    .footer-payment-icon,
    .footer-shipping-icon {
        height: 24px;
    }
}

/* Help & Support columns on mobile */
@media (max-width: 1279px) {
    .help-support-columns {
        column-count: 2;
        column-gap: 1rem;
    }
}

.footer-brands {
    border-top: 1px solid #e5e7eb;
    padding-top: 0.85rem;
    margin-top: 0.85rem;
}

.footer-brands-top {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 0.7rem;
}

.footer-brand-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
}

.footer-brand-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    min-width: 140px;
}

.footer-brand-letter {
    font-weight: 700;
    font-size: 0.7rem;
    color: #111;
    min-width: 20px;
}

.footer-brand-items {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.footer-brand-items a {
    color: #4a5568;
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 1.2;
}

.footer-brand-items a:hover {
    color: #111;
    text-decoration: none;
}

/* Arabic footer brands alignment */
html[lang^="ar"] .footer-brand-groups {
    justify-content: flex-end;
}

html[lang^="ar"] .footer-brand-group {
    align-items: flex-end;
}

html[lang^="ar"] .footer-brand-letter {
    text-align: right;
}

html[lang^="ar"] .footer-brand-items {
    align-items: flex-end;
}

html[lang^="ar"] .footer-brand-items a {
    text-align: right;
    direction: rtl;
    unicode-bidi: plaintext;
}

@media (max-width: 768px) {
    .footer-brand-picker {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
        gap: 0.35rem;
        margin-bottom: 0.6rem;
    }

    .footer-brand-pill {
        border: 1px solid #e5e7eb;
        background: #fff;
        color: #111;
        font-weight: 600;
        font-size: 0.95rem;
        border-radius: 999px;
        padding: 0.25rem 0;
        line-height: 1;
        text-align: center;
    }

    .footer-brand-pill.is-active {
        background: #111;
        color: #fff;
        border-color: #111;
    }

    .footer-brand-panels {
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        padding: 0.6rem 0.7rem;
        background: #fff;
    }

    .footer-brand-panel {
        display: none;
    }

    .footer-brand-panel.is-active {
        display: block;
    }

    .footer-brand-panels .footer-brand-items {
        columns: 2;
        column-gap: 1rem;
    }

    .footer-brand-panels .footer-brand-items a {
        font-size: 0.9rem;
        break-inside: avoid;
        padding: 0.1rem 0;
    }

    html[lang^="ar"] .footer-brand-picker {
        direction: rtl;
    }

    html[lang^="ar"] .footer-brand-panels {
        text-align: right;
    }

    html[lang^="ar"] .footer-brand-panels .footer-brand-items a {
        text-align: right;
        direction: rtl;
        unicode-bidi: plaintext;
    }
}

@media (max-width: 768px) {
    .footer-brand-group {
        min-width: 100%;
    }
}

@media (max-width: 768px) {
    .footer-social a {
        width: 30px;
        height: 30px;
    }

}

/* Common container styles */
.container-fluid {
    padding-left: 15px;
    padding-right: 15px;
}

/* Common navbar brand styling */
.navbar-brand {
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-decoration: none;
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 50%, #1a202c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto;
    animation: shimmer 3s linear infinite;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand.brand-logo-link {
    /* We use an image logo now; avoid animated/shimmer text styling to prevent flicker. */
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    -webkit-text-fill-color: initial;
    animation: none;
    text-shadow: none;
    transition: none;
}

/* Store desktop nav: logo truly centered on the full bar via CSS Grid.
   Bootstrap forces .navbar-collapse to display:flex !important at the
   navbar-expand-lg breakpoint, so this needs matching specificity (the
   compound .navbar-collapse.navbar-collapse-grid selector) plus its own
   !important to win. Two equal 1fr tracks flank an auto-sized center
   track - the center column always sits at the row's mathematical
   center regardless of how wide the category links or the search/
   actions block are, unlike a flex-grow or auto-margin approach, which
   both required the two sides to be "aware" of each other (confirmed by
   testing - a flex-grow middle item lost the available space entirely
   to a competing auto-margin on the actions block). */
.navbar-collapse.navbar-collapse-grid {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
}

.navbar-grid-start {
    grid-column: 1;
    justify-self: start;
    min-width: 0;
}

.navbar-grid-center {
    grid-column: 2;
    justify-self: center;
}

.navbar-grid-end {
    grid-column: 3;
    justify-self: end;
    min-width: 0;
}

.navbar-brand-inline-center {
    margin-right: 0;
    margin-left: 0;
    flex-shrink: 0;
}

.navbar-brand .brand-logo {
    height: 26px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
    transition: transform 0.15s ease;
}

@keyframes shimmer {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.navbar-brand:hover {
    text-decoration: none;
}

.navbar-brand:hover .brand-logo {
    transform: translateY(-1px);
}

/* Desktop search bar styling */
.search-bar-desktop {
    width: clamp(280px, 34vw, 620px);
    min-width: 0;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch;
    border: 1px solid #dee2e6;
    border-radius: 50px;
    overflow: visible !important;
    box-shadow: 0 2px 10px rgba(45, 55, 72, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

/* Explicit creamy class to override any remaining theme styles */
.search-bar-desktop.creamy-search,
.search-bar-desktop.creamy-search .form-control,
.search-bar-desktop.creamy-search button[type="submit"],
.search-bar-desktop.creamy-search .btn,
.search-bar-desktop.creamy-search .btn-outline-secondary,
.search-bar-desktop.creamy-search .category-search-dropdown .btn {
    background-color: #ffffff !important;
    border-color: #dee2e6 !important;
}

.search-bar-desktop.creamy-search .category-search-dropdown .dropdown-menu,
.search-bar-desktop.creamy-search .category-search-dropdown .dropdown-menu.show {
    background-color: #ffffff !important;
    border-color: #dee2e6 !important;
}

.search-bar-desktop.creamy-search .category-search-dropdown .dropdown-item:hover,
.search-bar-desktop.creamy-search .category-search-dropdown .dropdown-item:focus {
    background-color: #f5f5f5 !important;
}

/* Left separator line */
.search-bar-desktop::before {
    content: '';
    position: absolute;
    left: 50px;
    top: 25%;
    height: 50%;
    width: 1px;
    background-color: #e9ecef;
    pointer-events: none;
    z-index: 100;
}

/* Right separator line */
.search-bar-desktop::after {
    content: '';
    position: absolute;
    right: 50px;
    top: 25%;
    height: 50%;
    width: 1px;
    background-color: #e9ecef;
    pointer-events: none;
    z-index: 100;
}

.search-bar-desktop:focus-within {
    box-shadow: none;
}

.search-bar-desktop .form-control {
    font-size: 0.95rem;
    padding: 0.55rem 1rem;
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    border-radius: 0;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

.navbar .search-bar-desktop,
.navbar .search-bar-desktop .form-control,
.navbar .search-bar-desktop button[type="submit"],
.navbar .search-bar-desktop .btn,
.navbar .search-bar-desktop .btn-outline-secondary,
.navbar .category-search-dropdown .btn {
    background-color: #ffffff !important;
    border-color: #dee2e6 !important;
}

.navbar .search-bar-desktop .form-control::placeholder {
    color: #6c757d;
}

/* Force creamy category dropdown menu */
.navbar .category-search-dropdown .dropdown-menu,
.navbar .category-search-dropdown .dropdown-menu.show {
    background-color: #ffffff !important;
    border-color: #dee2e6 !important;
}

.navbar .category-search-dropdown .dropdown-menu.creamy-dropdown {
    background-color: #ffffff !important;
    border-color: #dee2e6 !important;
}

.navbar .category-search-dropdown .dropdown-item {
    background-color: transparent;
}

.navbar .category-search-dropdown .dropdown-item:hover,
.navbar .category-search-dropdown .dropdown-item:focus {
    background-color: #f5f5f5 !important;
}

.search-bar-desktop .form-control:focus {
    box-shadow: none !important;
    outline: none !important;
    border: none !important;
}

.search-bar-desktop button[type="submit"] {
    padding: 0.5rem 0.85rem;
    flex-shrink: 0;
    flex-grow: 0;
    white-space: nowrap;
    min-width: 50px;
    max-width: 56px;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: none !important;
    border-radius: 0 50px 50px 0;
    transition: box-shadow 0.3s ease;
}

.search-bar-desktop button[type="submit"]:focus,
.search-bar-desktop button[type="submit"]:active {
    box-shadow: none !important;
    outline: none !important;
    border: none !important;
}


/* Search submit button with gradient */
.search-bar-desktop button[type="submit"] i,
.search-bar-mobile button[type="submit"] i {
    font-size: 0.95rem;
    margin: 0;
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Ensure navbar has higher z-index than subcategories */
.navbar {
    position: relative;
    z-index: 1050;
    overflow: visible !important;
}

.navbar .dropdown-menu {
    background-color: #ffffff;
    border-color: #e9ecef;
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
    background-color: #f5f5f5;
}

/* Category search dropdown - clean styling */
.category-search-dropdown {
    position: relative !important;
}

.category-search-dropdown .btn {
    padding: 0.5rem 0.85rem;
    flex-shrink: 0;
    flex-grow: 0;
    white-space: nowrap;
    min-width: 50px;
    max-width: 56px;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: none !important;
    border-radius: 50px 0 0 50px;
    transition: box-shadow 0.3s ease;
}

.category-search-dropdown .btn:focus,
.category-search-dropdown .btn:active,
.category-search-dropdown .btn.active,
.category-search-dropdown .btn.show {
    box-shadow: none !important;
    outline: none !important;
    border: none !important;
}


.category-search-dropdown .btn i {
    font-size: 0.95rem;
    margin: 0;
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.category-search-dropdown .dropdown-menu {
    background-color: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    position: absolute !important;
    z-index: 10500 !important;
    top: calc(100% + 2px) !important;
    left: 0 !important;
}

.category-search-dropdown .dropdown-item {
    color: #212529;
}

.category-search-dropdown .dropdown-item:hover {
    background-color: #f5f5f5;
}

.category-search-dropdown .dropdown-item.active {
    background-color: #f8f9fa;
    color: #2d3748;
}

/* General input-group styling to prevent wrapping - only for search bars */
.search-bar-desktop .input-group,
.d-lg-none .flex-grow-1 .input-group,
.filter-card .input-group,
form[action*="search"] .input-group,
form[action*="orders"] .input-group {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch;
}

.search-bar-desktop .input-group .form-control,
.d-lg-none .flex-grow-1 .input-group .form-control,
.filter-card .input-group .form-control,
form[action*="search"] .input-group .form-control,
form[action*="orders"] .input-group .form-control {
    flex: 1 1 auto;
    min-width: 0;
}

.search-bar-desktop .input-group .btn,
.d-lg-none .flex-grow-1 .input-group .btn,
.filter-card .input-group .btn,
form[action*="search"] .input-group .btn,
form[action*="orders"] .input-group .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Ensure password fields and other form inputs are NOT affected */
.password-field-wrapper,
.form-group:not(.input-group),
.form-control:not(.input-group .form-control) {
    /* Reset any input-group styles that might leak */
    flex: none !important;
}

/* Profile dropdown styling */
.profile-dropdown {
    min-width: 200px;
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    top: 100% !important;
    bottom: auto !important;
    transform: none !important;
}

/* Language modal (shared across store/seller/admin base templates). */
.cream-modal {
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
}

.cream-modal-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e9ecef;
    align-items: center;
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
    overflow: visible;
}

#languageModal .modal-title {
    display: block;
    margin: 0;
    line-height: 1.65;
    white-space: normal;
    overflow: visible;
    max-width: calc(100% - 2.5rem);
    padding-top: 0.05rem;
    padding-bottom: 0.05rem;
    text-transform: none !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

#languageModal .language-title-ar {
    display: inline-block;
    line-height: 1.65;
    font-family: "Noto Naskh Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
    vertical-align: baseline;
    text-transform: none !important;
    letter-spacing: 0 !important;
    word-spacing: normal !important;
}

#languageModal .language-title-divider {
    opacity: 0.65;
}

.cream-modal-body {
    background-color: #ffffff;
}

#languageModal .btn.active {
    border-color: #212529;
    color: #212529;
    font-weight: 600;
}

#languageModal .language-option-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#languageModal .language-flag {
    line-height: 1;
    font-size: 1.05rem;
}

#languageModal .language-continue-btn {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.9rem;
}

#languageModal .language-continue-btn:hover,
#languageModal .language-continue-btn:focus {
    color: #212529;
    text-decoration: underline;
}

html[lang^="ar"] #languageModal .cream-modal-header {
    position: relative;
    padding-left: 2.75rem;
}

html[lang^="ar"] #languageModal .cream-modal-header .btn-close {
    margin: 0;
    position: absolute;
    left: 0.75rem;
    right: auto;
    top: 50%;
    transform: translateY(-50%);
}

.profile-dropdown .dropdown-item {
    padding: 1rem 1.25rem;
    font-size: 1.05rem;
    color: #333;
}

.profile-dropdown .dropdown-item:hover {
    text-decoration: none;
}

.profile-dropdown .dropdown-item.disabled {
    color: #6c757d;
    cursor: not-allowed;
}

.profile-dropdown .dropdown-item.disabled:hover {
    background-color: transparent;
    color: #6c757d;
}

.profile-dropdown .dropdown-divider {
    margin: 0.5rem 0;
    border-color: #e9ecef;
}

.profile-dropdown .dropdown-item i {
    width: 20px;
    text-align: center;
}

.account-dropdown .dropdown-item {
    padding: 1rem 1.25rem;
    font-size: 1.05rem;
}

.account-dropdown {
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.account-dropdown .dropdown-item i {
    width: 20px;
    text-align: center;
}

/* Override Bootstrap default dropdown hover effects with subtle highlighting */
.dropdown-item:hover,
.dropdown-item:focus {
    background-color: #f8f9fa !important;
    color: inherit !important;
    text-decoration: none !important;
}

/* Light hover effects on dropdown toggle buttons */
.btn-link.dropdown-toggle {
    transition: background-color 0.2s ease;
    border-radius: 8px;
}

.btn-link.dropdown-toggle:hover,
.btn-link.dropdown-toggle:focus {
    background-color: #f8f9fa !important;
    text-decoration: none !important;
}

/* Common icon styling */
.fas {
    transition: all 0.3s ease;
}

/* Common alert styling */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Common card styling */
.card {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Common input styling */
.form-control {
    border-radius: 6px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #6c757d;
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}

/* Common badge styling */
.badge {
    border-radius: 4px;
    font-weight: 500;
}

/* Common spacing utilities */
.mt-10 {
    margin-top: 10px;
}

.mb-10 {
    margin-bottom: 10px;
}

/* Common text utilities */
.text-muted {
    color: #6c757d !important;
}

.text-black {
    color: #000 !important;
}

/* Active navigation link styling */
.nav-link.text-primary.fw-bold {
    color: #0d6efd !important;
    font-weight: bold !important;
}

/* More specific rule for top category links */
.navbar-nav .nav-item .nav-link.text-primary.fw-bold.top-category-link {
    color: #0d6efd !important;
    font-weight: bold !important;
}

/* Common background utilities */
.bg-light {
    background-color: #f8f9fa !important;
}

/* Common border utilities */
.border-light {
    border-color: #dee2e6 !important;
}

/* Common shadow utilities */
.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Common transition utilities */
.transition {
    transition: all 0.3s ease;
}

/* Common hover effects */
.hover-scale:hover {
    transform: scale(1.05);
}

.hover-lift:hover {
    transform: translateY(-2px);
}

/* Common focus states */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}

/* Remove button focus styles globally */
.btn:focus,
.btn:focus-visible,
.btn:active:focus,
.btn.active:focus,
.btn.show:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Dropdown header close button — shared across all dashboards and store */
.notification-dropdown-close {
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.5rem;
    font-size: 1.2rem;
    color: #6c757d;
    cursor: pointer;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.notification-dropdown-close:hover {
    color: #212529;
    border-color: #adb5bd;
    background-color: #f8f9fa;
}

/* Ensure navbar doesn't clip dropdowns */
.navbar,
.navbar .container-fluid,
.navbar-collapse {
    overflow: visible !important;
}

/* Legal policy content (T&C, Privacy, Cookie) */
.legal-content {
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.75;
}

.legal-content p {
    margin-bottom: 0.9rem;
}

.legal-content p:first-child {
    font-weight: 700;
    font-size: 1rem;
    color: #0f172a;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    padding-bottom: 0.4rem;
    margin-bottom: 1rem;
}

.legal-content p:last-child {
    margin-bottom: 0;
}

/* Raised modals. The storefront's sticky mobile header/search (z 1300–1400)
   and Nour's floating chat button (z 1500) sit above Bootstrap's modal layer
   (1055) and would cover a modal's header and buttons on phones. A modal
   with .zn-modal-raised is lifted above them — and above the 10500 dropdown
   layer. Its backdrop follows via a body class set on show.bs.modal (before
   Bootstrap inserts the backdrop) and cleared on hidden.bs.modal (after it is
   removed) by base_common.js, so it never flickers beneath the header while
   fading in or out — unlike a :has(.modal.show) selector, which only matches
   once the fade-in has started. */
.modal.zn-modal-raised {
    z-index: 11000;
}
body.zn-modal-raised-open .modal-backdrop {
    z-index: 10990;
}

/* ─────────────────────────────────────────────────────────────
   Phone bottom tab bar (partials/_mobile_tabbar.html, below the lg breakpoint).
   ───────────────────────────────────────────────────────────── */
.mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    display: flex;
    background: #fff;
    border-top: 1px solid #e6e6e6;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-tabbar .mobile-tab {
    position: relative;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 56px;
    padding: 6px 2px;
    border: 0;
    background: none;
    color: #6b7280;
    font-size: 0.68rem;
    line-height: 1.1;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.mobile-tabbar .mobile-tab i {
    font-size: 1.15rem;
}

.mobile-tabbar .mobile-tab.is-active {
    color: #111;
    font-weight: 600;
}

.mobile-tabbar .mobile-tab-badge {
    position: absolute;
    top: 4px;
    inset-inline-start: calc(50% + 6px);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #dc3545;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 600;
}

/* Leave room for the bar so the last content is not hidden behind it. */
@media (max-width: 991.98px) {
    body:has(.mobile-tabbar) {
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* Buttons used as tabs (the portals' Menu tab) look like the link tabs. */
.mobile-tabbar button.mobile-tab {
    font-family: inherit;
    letter-spacing: inherit;
    cursor: pointer;
}

/* Portals: the bar steps aside while a field has focus, so the on-screen
   keyboard and the form's own buttons are never covered. */
body.portal-tabbar-hidden .mobile-tabbar {
    display: none;
}

@media (max-width: 991.98px) {
    body.portal-tabbar-hidden:has(.mobile-tabbar) {
        padding-bottom: 0 !important;
    }
}

/* ─────────────────────────────────────────────────────────────
   Phone bottom sheet (static/js/mobile_sheet.js): the store's Account menu
   (partials/_account_sheet.html) and the portals' Menu
   (navigation/portal_menu_sheet.html). Below the lg breakpoint only.
   ───────────────────────────────────────────────────────────── */
.mobile-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 1490;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

.mobile-sheet-overlay.show {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease;
}

.mobile-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    max-height: 88vh;
    max-height: 88dvh;
    border-radius: 18px 18px 0 0;
    background: #f7f7f8;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
    outline: 0;
}

.mobile-sheet.show {
    transform: translateY(0);
    visibility: visible;
    transition: transform 0.25s ease;
}

.mobile-sheet.is-dragging {
    transition: none;
}

body.mobile-sheet-open {
    overflow: hidden;
}

.mobile-sheet-handle {
    display: flex;
    justify-content: center;
    flex-shrink: 0;
    padding: 10px 0 6px;
    touch-action: none;
}

.mobile-sheet-handle::before {
    content: "";
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: #cfcfd4;
}

.mobile-sheet-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0 1rem 1rem;
}

.mobile-sheet-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-inline-start: auto;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    background: #ececee;
    color: #333;
    font-size: 0.9rem;
}

@media (min-width: 992px) {
    .mobile-sheet,
    .mobile-sheet-overlay {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-sheet,
    .mobile-sheet-overlay {
        transition: none;
    }
}

/* Menu rows inside a sheet: initials, a greeting, then grouped rows. */
.account-menu-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.25rem 0 1rem;
}

.account-menu-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #e9e9ec;
    color: #555;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.account-menu-who {
    min-width: 0;
}

.account-menu-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111;
}

.account-menu-email {
    font-size: 0.82rem;
    color: #6b7280;
    overflow-wrap: anywhere;
}

.account-menu-group {
    margin-bottom: 0.9rem;
    border: 1px solid #ececec;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.account-menu-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    min-height: 52px;
    padding: 0 1rem;
    border: 0;
    background: none;
    color: #111;
    font-size: 0.95rem;
    text-align: start;
    text-decoration: none;
}

.account-menu-row:hover,
.account-menu-row:focus {
    color: #111;
    text-decoration: none;
}

.account-menu-row + .account-menu-row {
    border-top: 1px solid #f1f1f1;
}

.account-menu-row > i {
    width: 20px;
    color: #555;
    text-align: center;
}

.account-menu-row::after {
    content: "\f054";
    margin-inline-start: auto;
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 0.7rem;
    color: #b5b5b5;
}

[dir="rtl"] .account-menu-row::after {
    content: "\f053";
}

.account-menu-meta {
    margin-inline-start: auto;
    color: #6b7280;
    font-size: 0.85rem;
}

.account-menu-row:has(.account-menu-meta)::after {
    margin-inline-start: 0.6rem;
}

.account-menu-row.is-disabled {
    color: #9ca3af;
    pointer-events: none;
}

.account-menu-row.is-disabled::after {
    display: none;
}

.account-menu-signout,
.account-menu-signout:hover,
.account-menu-signout:focus,
.account-menu-signout > i {
    color: #9b2c2c;
}

.account-menu-signout::after {
    display: none;
}

/* The portals' section list inside the Menu sheet. It reuses each portal's
   sidebar partial (one list for desktop and phone), so the rows are restyled
   here: an <hr> in the list starts a new group. */
.sheet-nav {
    margin: 0 0 0.9rem;
    padding: 0;
    list-style: none;
}

.sheet-nav > hr {
    height: 0.9rem;
    margin: 0;
    border: 0;
    opacity: 0;
}

.sheet-nav > hr:first-child,
.sheet-nav > hr:last-child,
.sheet-nav > hr + hr {
    display: none;
}

.sheet-nav > .nav-item {
    margin: 0;
    border: 1px solid #ececec;
    border-top-width: 0;
    background: #fff;
}

.sheet-nav > .nav-item:first-child,
.sheet-nav > hr + .nav-item {
    border-top-width: 1px;
    border-start-start-radius: 14px;
    border-start-end-radius: 14px;
}

.sheet-nav > .nav-item:last-child,
.sheet-nav > .nav-item:has(+ hr) {
    border-end-start-radius: 14px;
    border-end-end-radius: 14px;
}

.sheet-nav > .nav-item + .nav-item > .nav-link {
    border-top: 1px solid #f1f1f1;
}

.sheet-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-height: 52px;
    padding: 0 1rem;
    border-radius: 0;
    background: none;
    color: #111;
    font-size: 0.95rem;
    font-weight: 400;
    text-decoration: none;
}

.sheet-nav .nav-link::before {
    content: none;
}

.sheet-nav .nav-link::after {
    content: "\f054";
    margin-inline-start: auto;
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 0.7rem;
    color: #b5b5b5;
}

[dir="rtl"] .sheet-nav .nav-link::after {
    content: "\f053";
}

.sheet-nav .nav-link.active {
    font-weight: 700;
}

.sheet-nav .nav-link.active .nav-icon {
    color: #111;
}

.sheet-nav .nav-icon {
    display: inline-flex;
    justify-content: center;
    width: 20px;
    color: #555;
}

.sheet-nav .nav-link .badge {
    margin-inline-start: auto;
}

.sheet-nav .nav-link:has(.badge)::after {
    margin-inline-start: 0.6rem;
}

/* Group breaks meant for the sheet only. */
.sidebar-nav .sheet-nav-break {
    display: none;
}

/* Desktop-only sidebar extras (host resources, deploy shortcut). */
.sheet-nav .admin-infra-widget-item,
.sheet-nav .nav-item:has(> .admin-deploy-sidebar-form) {
    display: none;
}

/* Portals: the one phone top bar names the workspace next to the logo. */
.portal-label {
    display: inline-flex;
    justify-self: start;
    align-items: center;
    min-height: 22px;
    padding: 0 0.55rem;
    border-radius: 999px;
    background: #f1f1f3;
    color: #444;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Portals, phones: the breadcrumb trail collapses to one "‹ Parent" back
   link, like the "‹ Account" link on the store's account pages. Top-level
   pages (a single crumb) show none. */
@media (max-width: 991.98px) {
    .dashboard-body .main-content nav[aria-label="breadcrumb"] .breadcrumb {
        margin: 0;
        padding: 0;
        background: none;
    }

    .dashboard-body .main-content nav[aria-label="breadcrumb"] .breadcrumb-item {
        display: none;
    }

    .dashboard-body .main-content nav[aria-label="breadcrumb"] .breadcrumb-item:nth-last-child(2) {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        min-height: 36px;
        padding: 0;
        color: #111;
        font-size: 0.9rem;
        font-weight: 600;
    }

    .dashboard-body .main-content nav[aria-label="breadcrumb"] .breadcrumb-item:nth-last-child(2)::before {
        content: "\f053";
        float: none;
        padding: 0;
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        font-size: 0.75rem;
        color: #111;
    }

    [dir="rtl"] .dashboard-body .main-content nav[aria-label="breadcrumb"] .breadcrumb-item:nth-last-child(2)::before {
        content: "\f054";
    }

    .dashboard-body .main-content nav[aria-label="breadcrumb"] .breadcrumb-item:nth-last-child(2) a {
        color: inherit;
        text-decoration: none;
    }

    .dashboard-body .main-content nav[aria-label="breadcrumb"] .breadcrumb-item:nth-last-child(2) i {
        display: none;
    }
}

/* ─────────────────────────────────────────────────────────────
   Phones: a wide table becomes a stack of cards, one per row. Opt in with
   class "table-stack-mobile" on the <table>; static/js/table_stack_mobile.js
   copies each column heading onto its cells as data-label.
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .table-responsive:has(> table.table-stack-mobile) {
        overflow: visible;
        border: 0;
    }

    table.table-stack-mobile,
    table.table-stack-mobile > tbody,
    table.table-stack-mobile > tbody > tr,
    table.table-stack-mobile > tbody > tr > td,
    table.table-stack-mobile > tbody > tr > th {
        display: block;
        width: 100%;
    }

    table.table-stack-mobile {
        margin-bottom: 0;
        border: 0;
        background: none;
    }

    table.table-stack-mobile > thead,
    table.table-stack-mobile > colgroup {
        display: none;
    }

    table.table-stack-mobile > tbody > tr {
        margin-bottom: 0.75rem;
        padding: 0.35rem 0.9rem;
        border: 1px solid #ececec;
        border-radius: 14px;
        background: #fff;
    }

    table.table-stack-mobile > tbody > tr > td,
    table.table-stack-mobile > tbody > tr > th {
        position: relative;
        min-height: 0;
        padding: 0.5rem 0;
        border: 0;
        border-bottom: 1px solid #f3f3f3;
        background: none !important;
        box-shadow: none;
        text-align: start;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    table.table-stack-mobile > tbody > tr > :last-child {
        border-bottom: 0;
    }

    /* The column heading sits in a left column; the cell's own content (text,
       badges, buttons, several chips) wraps normally beside it. */
    table.table-stack-mobile > tbody > tr > [data-label] {
        padding-inline-start: 40%;
    }

    table.table-stack-mobile > tbody > tr > [data-label]::before {
        content: attr(data-label);
        position: absolute;
        top: 0.5rem;
        inset-inline-start: 0;
        width: calc(40% - 0.75rem);
        color: #6b7280;
        font-size: 0.78rem;
        font-weight: 600;
        line-height: 1.35;
        text-align: start;
    }

    /* Cells with no heading (checkboxes, action buttons) and full-width
       rows (empty states) use the whole line. */
    table.table-stack-mobile > tbody > tr > td:not([data-label]),
    table.table-stack-mobile > tbody > tr > td[colspan] {
        padding-inline-start: 0;
    }

    table.table-stack-mobile > tbody > tr > td[colspan]::before {
        content: none;
    }

    table.table-stack-mobile .text-end,
    table.table-stack-mobile .text-center {
        text-align: start !important;
    }

    table.table-stack-mobile > tbody > tr > td > .btn,
    table.table-stack-mobile > tbody > tr > td > form {
        margin-bottom: 0.25rem;
    }

    table.table-stack-mobile > tbody > tr > td:empty {
        display: none;
    }
}

/* ── Phone footer: brands as one row, inline newsletter, collapsible link groups ── */
.footer-brands-link {
    display: none;
}

@media (max-width: 767.98px) {
    .site-footer .footer-brands-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 52px;
        margin: 0 0 0.75rem;
        padding: 0 0.15rem;
        border-bottom: 1px solid #ececec;
        color: #111;
        font-size: 0.85rem;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-decoration: none;
        text-transform: uppercase;
    }

    [dir="rtl"] .site-footer .footer-brands-link .fa-chevron-right {
        transform: scaleX(-1);
    }

    .site-footer .footer-brand {
        margin-bottom: 0.25rem;
    }

    .site-footer .footer-subscribe {
        width: 100%;
        flex-wrap: nowrap;
        margin-bottom: 1rem;
    }

    /* A global rule sets `.form-control:not(.input-group .form-control) { flex: none
       !important }`, so the email field could neither grow nor shrink and Subscribe
       was pushed off-screen. Let it fill the row next to the button. */
    .site-footer .footer-subscribe .form-control {
        width: auto;
        min-width: 0;
        flex: 1 1 0 !important;
    }

    /* Some account pages style every .btn-primary at width 100%; keep the footer's
       Subscribe button its natural size so it never runs off the screen. */
    .site-footer .footer-subscribe .btn {
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: 45%;
    }

    /* Groups are reordered with order-* classes, so each draws its bottom line and
       only the first one shown (Help & Support) draws a top line. */
    .site-footer .footer-group {
        flex: 0 0 100%;
        max-width: 100%;
        border-bottom: 1px solid #ececec;
    }

    .site-footer .footer-group.order-1 {
        border-top: 1px solid #ececec;
    }

    .site-footer .footer-group-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 50px;
        margin: 0 !important;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .site-footer .footer-group-title::after {
        content: "\f078";
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        font-size: 0.7rem;
        color: #9ca3af;
        transition: transform 0.15s ease;
    }

    .site-footer .footer-group.is-open .footer-group-title::after {
        transform: rotate(180deg);
    }

    .site-footer .footer-group .footer-links {
        display: none !important;
        margin: 0 0 0.75rem !important;
    }

    .site-footer .footer-group.is-open .footer-links {
        display: flex !important;
    }

    /* Room so the floating Nour button doesn't sit on the last row. */
    .site-footer {
        padding-bottom: 4.5rem;
    }
}
