/* ================================================================
   MOBILE-ONLY STYLES FOR SHOPS PAGE (< 768px)
   ================================================================ */

@media (max-width: 768px) {
    /* ===== HEADER COMPACT ===== */
    header {
        padding: 0 !important;
        min-height: 48px;
    }

    header .container {
        padding-top: 0.25rem !important;
        padding-bottom: 0.25rem !important;
    }

    header h1 {
        font-size: 0.95rem !important;
    }

    header .w-10.h-10 {
        width: 1.6rem !important;
        height: 1.6rem !important;
    }

    header .w-10.h-10 i {
        font-size: 0.7rem !important;
    }

    /* ===== MAIN CONTENT SPACING ===== */
    main {
        padding: 0.5rem 0 !important;
    }

    section.text-center {
        padding: 0.75rem 0 !important;
        margin-bottom: 0.75rem !important;
    }

    section.text-center h2 {
        font-size: 1.3rem !important;
        margin-bottom: 0.15rem !important;
        line-height: 1.2 !important;
    }

    section.text-center p {
        font-size: 0.8rem !important;
        margin-bottom: 0.5rem !important;
        color: rgba(248, 250, 252, 0.6) !important;
        line-height: 1.4 !important;
    }

    /* Hide floating decorations */
    section.text-center .absolute {
        display: none !important;
    }

    /* ===== SHOP SELECT DROPDOWN ===== */
    #shopSelect {
        width: 100% !important;
        min-height: 44px !important;
        font-size: 16px !important;
        padding: 0.65rem 2.5rem 0.65rem 1rem !important;
        border-radius: 0.6rem !important;
        background: rgba(30, 41, 59, 0.8) !important;
        border: 1px solid rgba(139, 92, 246, 0.2) !important;
        color: #f8fafc !important;
    }

    /* ===== SHOPKEEPER SECTION ===== */
    .max-w-2xl.mx-auto.mb-12 {
        margin-bottom: 0.75rem !important;
    }

    #shopkeeperName {
        font-size: 0.95rem !important;
    }

    #shopkeeperDesc {
        font-size: 0.75rem !important;
    }

    .npc-avatar {
        width: 3.5rem !important;
        height: 3.5rem !important;
        font-size: 1.75rem !important;
        margin-bottom: 0.5rem !important;
    }

    .npc-bubble {
        padding: 0.6rem 0.75rem !important;
        font-size: 0.8rem !important;
        border-radius: 1rem !important;
        min-height: auto !important;
        min-width: auto !important;
    }

    .talk-btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.8rem !important;
        border-radius: 0.5rem !important;
        width: 100% !important;
        margin-top: 0.5rem !important;
    }

    #shopInfoBtn {
        width: 100% !important;
        padding: 0.5rem 1rem !important;
        font-size: 0.8rem !important;
        border-radius: 0.5rem !important;
        margin-top: 0.5rem !important;
    }

    #inventoryBtn {
        width: 100% !important;
        padding: 0.5rem 1rem !important;
        font-size: 0.8rem !important;
        border-radius: 0.5rem !important;
        margin-top: 0.5rem !important;
    }

    /* ===== GOLD BAR ===== */
    .gold-bar {
        justify-content: center !important;
        font-size: 0.95rem !important;
    }

    .gold-bar .fa-coins {
        font-size: 1.1rem !important;
    }

    /* ===== SHOP SEARCH ===== */
    #shopSearchInput {
        width: 100% !important;
        padding: 0.55rem 0.75rem !important;
        font-size: 16px !important;
        border-radius: 0.5rem !important;
    }

    /* ===== SHOP ITEMS LIST ===== */
    .max-w-2xl.mx-auto {
        padding: 0 0.5rem !important;
    }

    #shopItemsList {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .shop-item-card {
        padding: 0.6rem !important;
        margin-bottom: 0 !important;
        border-radius: 0.6rem !important;
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .shop-item-icon {
        width: 2.5rem !important;
        height: 2.5rem !important;
        font-size: 1.2rem !important;
        margin-right: 0 !important;
        margin-bottom: 0.35rem !important;
    }

    .shop-item-name {
        font-size: 0.85rem !important;
    }

    .shop-item-desc {
        font-size: 0.7rem !important;
    }

    .shop-item-price {
        font-size: 0.85rem !important;
        margin-left: 0 !important;
        margin-top: 0.25rem !important;
    }

    .shop-item-buy {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 0.35rem !important;
        padding: 0.4rem !important;
        font-size: 0.75rem !important;
        border-radius: 0.4rem !important;
    }

    /* ===== SHOP INFO MODAL ===== */
    #shopInfoModal.modal-overlay {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    #shopInfoModal .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 70vh !important;
        height: auto !important;
        border-radius: 1rem 1rem 0 0 !important;
        margin: 0 !important;
        background: linear-gradient(180deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.99) 100%) !important;
        border-top: 1px solid rgba(139, 92, 246, 0.15) !important;
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5) !important;
        padding: 1rem !important;
    }

    #modalNpcAvatar {
        width: 3.5rem !important;
        height: 3.5rem !important;
        font-size: 1.75rem !important;
    }

    #modalShopkeeperName {
        font-size: 0.95rem !important;
    }

    #modalShopkeeperDesc {
        font-size: 0.75rem !important;
    }

    #modalShopName {
        font-size: 0.85rem !important;
    }

    #modalShopExtra {
        font-size: 0.7rem !important;
    }

    #modalCloseButton {
        width: 2rem !important;
        height: 2rem !important;
        border-radius: 50% !important;
        background: rgba(255, 255, 255, 0.06) !important;
    }

    /* ===== ITEM MODAL ===== */
    #itemModal.modal-overlay {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    #itemModal .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 50vh !important;
        height: auto !important;
        border-radius: 1rem 1rem 0 0 !important;
        margin: 0 !important;
        background: linear-gradient(180deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.99) 100%) !important;
        border-top: 1px solid rgba(139, 92, 246, 0.15) !important;
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5) !important;
        padding: 1rem !important;
    }

    #itemModalIcon {
        font-size: 2rem !important;
        margin-bottom: 0.35rem !important;
    }

    #itemModalName {
        font-size: 1rem !important;
    }

    #itemModalDesc {
        font-size: 0.75rem !important;
    }

    #itemModalPrice {
        font-size: 0.9rem !important;
    }

    /* ===== INVENTORY MODAL ===== */
    #inventoryModal.modal-overlay {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    #inventoryModal .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 80vh !important;
        height: auto !important;
        border-radius: 1rem 1rem 0 0 !important;
        margin: 0 !important;
        background: linear-gradient(180deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.99) 100%) !important;
        border-top: 1px solid rgba(139, 92, 246, 0.15) !important;
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5) !important;
        padding: 1rem !important;
    }

    #inventoryModal h3 {
        font-size: 1rem !important;
    }

    .inventory-item {
        padding: 0.5rem 0.65rem !important;
        margin-bottom: 0.35rem !important;
        border-radius: 0.5rem !important;
        font-size: 0.8rem !important;
    }

    /* ===== FOOTER MOBILE ===== */
    footer .grid {
        display: block !important;
        text-align: center !important;
    }

    footer .grid > div {
        display: none !important;
    }

    footer .grid > div:first-child {
        display: block !important;
        text-align: center !important;
    }

    footer .grid > div:first-child .flex {
        justify-content: center !important;
    }

    footer .border-t {
        padding-top: 0.75rem !important;
    }

    footer .border-t .text-sm {
        font-size: 0.6rem !important;
    }

    /* ===== TOAST ===== */
    #toast {
        width: calc(100% - 2rem) !important;
        left: 1rem !important;
        transform: translateX(0) !important;
        bottom: 4rem !important;
        font-size: 0.85rem !important;
        padding: 0.65rem 1rem !important;
        border-radius: 0.75rem !important;
    }

    /* ===== MOBILE MENU BUTTON - HIDDEN (replaced by FAB) ===== */
    #openSidebar {
        display: none !important;
    }

    /* ===== SIDEBAR MOBILE ===== */
    #mobileSidebar {
        width: 80vw !important;
        max-width: 18rem !important;
    }

    #mobileSidebar nav a {
        padding: 0.6rem 0.75rem !important;
        font-size: 0.85rem !important;
    }
}

/* ===== EXTRA SMALL SCREENS (<=420px) ===== */
@media (max-width: 420px) {
    .npc-bubble {
        font-size: 0.75rem !important;
        padding: 0.5rem 0.65rem !important;
    }

    .npc-avatar {
        width: 3rem !important;
        height: 3rem !important;
        font-size: 1.5rem !important;
    }

    .shop-item-card {
        padding: 0.5rem !important;
    }

    .shop-item-icon {
        width: 2rem !important;
        height: 2rem !important;
        font-size: 1rem !important;
    }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-height: 500px) and (orientation: landscape) {
    #shopInfoModal .modal-content,
    #itemModal .modal-content,
    #inventoryModal .modal-content {
        max-height: 85vh !important;
    }
}

/* ===== FAB NAVIGATION ===== */
#fabNavContainer {
    display: flex !important;
    position: fixed !important;
    bottom: calc(env(safe-area-inset-bottom, 0.5rem) + 1.5rem) !important;
    left: calc(env(safe-area-inset-left, 0.5rem) + 1.5rem) !important;
    z-index: 999 !important;
}

#fabNavBtn {
    display: flex !important;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.85rem;
    min-height: 3rem;
    border-radius: 1.5rem;
    background: rgba(16, 185, 129, 0.2) !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.25), 0 1px 3px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(16px) saturate(1.8);
    -webkit-backdrop-filter: blur(16px) saturate(1.8);
    color: #6ee7b7 !important;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

#fabNavBtn i {
    font-size: 0.8rem !important;
}

#fabNavBtn .fab-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(248, 250, 252, 0.9);
    white-space: nowrap;
}

#fabNavBtn:active {
    transform: scale(0.93) !important;
    background: rgba(16, 185, 129, 0.35) !important;
}

/* FAB Drawer */
#fabNavDrawer {
    display: none !important;
    position: fixed !important;
    bottom: calc(env(safe-area-inset-bottom, 0.5rem) + 5rem) !important;
    left: calc(env(safe-area-inset-left, 0.5rem) + 1.5rem) !important;
    z-index: 998 !important;
    background: linear-gradient(180deg, rgba(20, 20, 35, 0.98) 0%, rgba(13, 13, 20, 0.99) 100%) !important;
    border: 1px solid rgba(139, 92, 246, 0.15) !important;
    border-radius: 1rem !important;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 0.5rem !important;
    min-width: 180px;
    transform: scale(0.75) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#fabNavDrawer.open {
    display: flex !important;
    flex-direction: column !important;
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

#fabNavDrawer a {
    display: flex !important;
    align-items: center;
    gap: 0.6rem !important;
    padding: 0.65rem 0.85rem !important;
    border-radius: 0.6rem !important;
    font-size: 0.8rem !important;
    color: rgba(248, 250, 252, 0.7) !important;
    transition: background-color 0.1s ease, transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

#fabNavDrawer a:active {
    transform: scale(0.97);
    background-color: rgba(139, 92, 246, 0.1) !important;
}

#fabNavDrawer a i {
    font-size: 0.85rem !important;
    width: 1.2rem;
    text-align: center;
}

/* FAB overlay backdrop */
#fabNavOverlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 997;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.25s ease;
}

#fabNavOverlay.open {
    display: block;
    opacity: 1;
}