/* Mobile refinements for the existing RTL storefront. */
.admin-bar-mobile-toggle { display: none; }
.admin-bar-actions { display: flex; align-items: center; justify-content: space-between; flex: 1; min-width: 0; }

/* Stack the authenticated toolbar and navigation without either layer covering the other. */
@media (min-width: 992px) {
    body.adminBarLoaded > .admin-bar {
        position: sticky;
        top: 0;
    }
    body.adminBarLoaded > header {
        position: sticky;
        top: var(--admin-bar-height, 39px) !important;
        background: #111;
    }
}

/* A shared anchor keeps both actions aligned in RTL and LTR layouts. */
body {
    --floating-edge: 20px;
    --floating-bottom: 20px;
    --floating-size: 56px;
    --floating-gap: 12px;
}
body .scroll-to-top,
body .assistant-widget-bubble {
    inset-inline-end: auto;
    left: var(--floating-edge);
    right: auto;
    width: var(--floating-size);
    height: var(--floating-size);
}
body .scroll-to-top { bottom: var(--floating-bottom); }
body .assistant-widget-bubble {
    bottom: var(--floating-bottom);
    transition: bottom .25s ease, background-color .2s ease;
}
body .assistant-widget-bubble.is-raised {
    inset-inline-end: auto;
    left: var(--floating-edge);
    right: auto;
    bottom: calc(var(--floating-bottom) + var(--floating-size) + var(--floating-gap));
}
body .assistant-widget-panel {
    inset-inline-end: auto;
    left: var(--floating-edge);
    right: auto;
    bottom: calc(var(--floating-bottom) + var(--floating-size) + var(--floating-gap));
    transition: bottom .25s ease;
}
body .assistant-widget-panel.is-raised {
    inset-inline-end: auto;
    left: var(--floating-edge);
    right: auto;
    bottom: calc(var(--floating-bottom) + var(--floating-size) + var(--floating-gap) + var(--floating-size) + var(--floating-gap));
}

main.home .productCardUnified .productImage {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f3f3f3;
}
main.home .productCardUnified .productImage img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: contain;
    margin: 0;
}

@media (max-width: 991px) {
    .dashboardWrapper .dashboardLayout { display: flex; flex-direction: column; gap: 1rem; width: 100%; }
    .dashboardWrapper .dashboardSidebar,
    .dashboardWrapper .dashboardContent { width: 100%; min-width: 0; max-width: 100%; }
    .dashboardWrapper .dashboardContent { overflow: hidden; }
    .dashboardWrapper .dashboardContent .wishlistGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
    body.adminBarLoaded .admin-bar {
        position: relative;
        width: 100%;
        padding: 0;
        z-index: 110;
    }
    body.adminBarLoaded > header {
        position: sticky;
        top: 0 !important;
    }
    .admin-bar .admin-bar-inner { display: block; min-height: 48px; padding: 0 16px; }
    .admin-bar-mobile-toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 48px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #f5b042;
        font: inherit;
        cursor: pointer;
    }
    .admin-bar-mobile-toggle .fa-angle-down { transition: transform .2s ease; }
    .admin-bar.is-open .admin-bar-mobile-toggle .fa-angle-down { transform: rotate(180deg); }
    .admin-bar .admin-bar-actions { display: none; padding: 8px 0 14px; }
    .admin-bar.is-open .admin-bar-actions { display: block; }
    .admin-bar .admin-bar-left,
    .admin-bar .admin-bar-right { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px; }
    .admin-bar .admin-bar-link { min-height: 44px; display: inline-flex; align-items: center; gap: 5px; padding: 8px 10px; }
    .admin-bar .admin-bar-logo { min-height: 44px; }
    .admin-bar .admin-bar-user { padding: 10px; }

    /* Keep the navigation control on the physical right in the RTL header. */
    header .col-logo { display: flex; align-items: center; justify-content: space-between; direction: ltr; text-align: start; }
    header .col-logo a img { height: 56px; max-width: min(62vw, 210px); object-fit: contain; }
    header .mobile-menu-toggle { min-width: 44px; min-height: 44px; }
    .mobile-bottom-nav { right: 0; bottom: 0; width: 100%; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
    body {
        --floating-edge: 16px;
        --floating-bottom: calc(86px + env(safe-area-inset-bottom));
        --floating-size: 48px;
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }
    body .assistant-widget-bubble { font-size: 21px; }
    body .assistant-widget-panel { max-height: min(60vh, 480px); }
}

@media (max-width: 420px) {
    .dashboardWrapper .dashboardContent .wishlistGrid { grid-template-columns: 1fr; }
}

@media (max-width: 576px) {
    main.home .newCollectionSlider .productCardUnified { width: 100%; min-width: 0; padding: 10px; }
    main.home .newCollectionSlider .productCardUnified .productImage img { width: 100%; height: 100%; }
    main.home .productCardUnified .productTitle { font-size: clamp(14px, 4vw, 18px); line-height: 1.5; }
    main.home .productCardUnified .productPrice { font-size: clamp(16px, 4.5vw, 22px); }
}

@media (prefers-reduced-motion: reduce) {
    .admin-bar-mobile-toggle .fa-angle-down { transition: none; }
    body .assistant-widget-bubble,
    body .assistant-widget-panel { transition: none; }
}
