/* ADAM storefront fixes - Raizer 2026-11-23. Loaded after adam-store.css (frontend/layouts/app.blade.php).
   Backup + rollback: /srv/shared/backups/storefront-fixes-2026-11-23/. Revert: delete this file and its <link>. */

/* ---------- 1. Low-stock badge ("almost sold out") ---------- */
.adam-lowstock {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px 5px 8px;
    border-radius: 3px;
    background: #d9480f;
    background: linear-gradient(135deg, #f76707 0%, #d9480f 100%);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(217, 72, 15, .28);
    pointer-events: none;
}
.adam-lowstock[hidden] { display: none !important; }
.adam-lowstock .adam-lowstock-ico { flex: 0 0 auto; width: 14px; height: 14px; color: #ffe8cc; }
.adam-lowstock > span { color: #fff !important; }
@media (prefers-reduced-motion: no-preference) {
    .adam-lowstock .adam-lowstock-ico { animation: adamFlicker 1.8s ease-in-out infinite; transform-origin: 50% 90%; }
    @keyframes adamFlicker { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.12); opacity: .85; } }
}

/* card: bottom inline-start of the photo (colour dots sit at bottom inline-end) */
.adam-pcard .adam-lowstock--card {
    position: absolute;
    bottom: 8px;
    inset-inline-start: 8px;
    z-index: 5;
    max-width: calc(100% - 16px);
    font-size: 10.5px;
    padding: 4px 7px 4px 6px;
}
.adam-pcard .adam-lowstock--card .adam-lowstock-ico { width: 12px; height: 12px; }
@media (min-width: 768px) {
    .adam-pcard .adam-lowstock--card { font-size: 11.5px; padding: 5px 9px 5px 8px; }
}

/* product page: on the main photo, top inline-start */
.main-slider > .adam-lowstock--img {
    position: absolute;
    top: 12px;
    inset-inline-start: 12px;
    z-index: 6;
    font-size: 12.5px;
    padding: 6px 11px 6px 9px;
}
.main-slider > .adam-lowstock--img .adam-lowstock-ico { width: 16px; height: 16px; }

/* product page: under "available / minimum qty" */
.adam-lowstock--qty {
    margin-top: 8px;
    margin-bottom: 8px;
    align-self: flex-start;
    font-size: 12.5px;
}

/* ---------- 2. Bottom mobile nav: filled icons ---------- */
.aiz-mobile-bottom-nav .adam-bn-ico {
    display: block;
    width: 22px;
    height: 22px;
    margin: 0 auto;
    color: #8d8d97;
}
.aiz-mobile-bottom-nav a > .d-inline-block > .adam-bn-ico { display: inline-block; }
.aiz-mobile-bottom-nav .svg-active .adam-bn-ico,
.aiz-mobile-bottom-nav .svg-active .adam-bn-ico * { color: var(--primary); fill: var(--primary) !important; }
.aiz-mobile-bottom-nav .mobile-side-nav-thumb .adam-bn-ico { display: inline-block; }

/* ---------- 3. Purchase history (/purchase_history) on phones ---------- */
@media (max-width: 767.98px) {
    /* the panel was wider than the screen (flex child with min-width:auto) */
    .aiz-user-panel { min-width: 0; max-width: 100%; }
    .aiz-user-panel > .card:has(#orderTabs) { padding: 16px !important; }
    .aiz-user-panel .card:has(#orderTabs) > .d-flex.border-bottom { flex-wrap: wrap; gap: 10px; }
    #orderTabs { margin: 0 !important; flex-wrap: wrap; gap: 4px 2px; width: 100%; }
    #orderTabs .nav-link { padding: 6px 10px; font-size: 12.5px; white-space: nowrap; }
    .aiz-user-panel .card:has(#orderTabs) .form-group.w-25 { width: 100% !important; }

    #tab-content > .mb-4 { padding-bottom: 4px; }
    #tab-content > .mb-4 > .d-flex.justify-content-between:first-child { flex-wrap: wrap; gap: 10px; align-items: flex-start !important; }
    #tab-content > .mb-4 > .d-flex.justify-content-between:first-child > div:first-child { flex: 1 1 100%; min-width: 0; }
    #tab-content > .mb-4 > .d-flex.justify-content-between:first-child p { font-size: 15px !important; line-height: 1.5; word-break: break-word; }
    #tab-content > .mb-4 > .d-flex.justify-content-between:first-child .d-md-none.d-flex { width: 100%; gap: 8px; }
    #tab-content .reorder-btn,
    #tab-content .btn-options {
        flex: 1 1 0;
        margin: 0 !important;
        padding: 8px 10px !important;
        font-size: 13px;
        white-space: nowrap;
        line-height: 1.3;
        text-align: center;
    }
    #tab-content .d-md-none .dropdown { flex: 1 1 0; display: flex; }
    #tab-content .d-md-none .dropdown .btn-options { width: 100%; }
    #tab-content .btn-on-the-way,
    #tab-content .btn-paid,
    #tab-content .btn-unpaid { font-size: 12px; padding: 4px 12px; margin-inline-end: 6px; }

    #tab-content .row.align-items-center.mb-3 { margin-left: 0; margin-right: 0; }
    #tab-content .row.align-items-center.mb-3 > .col-md-9 { padding-left: 0; padding-right: 0; }
    #tab-content .row.align-items-center.mb-3 .row { margin-left: 0; margin-right: 0; align-items: center; }
    #tab-content .row.align-items-center.mb-3 .row > .col-md-8 { flex: 1 1 0; min-width: 0; padding-left: 0; padding-right: 0; }
    #tab-content .row.align-items-center.mb-3 .row > .col-md-4 { flex: 0 0 auto; width: auto; padding-left: 0; padding-right: 0; text-align: end; }
    #tab-content .w-300px { width: auto !important; min-width: 0; flex: 1 1 auto; }
    #tab-content .product-history-img { width: 64px !important; height: 64px !important; object-fit: cover; flex: 0 0 64px; margin-inline-end: 12px !important; margin-right: 0; border-radius: 4px; }
    #tab-content .mobile-title-shift { margin: 0 !important; }
}

/* ---------- 4. Product gallery magnifier ---------- */
.preview-icon-container .adam-zoom-ico { display: block; width: 20px; height: 20px; }
