/* ==========================================================================
   GOWRI SHANKARI CLINIC - MOBILE RESPONSIVE & STICKY FOOTER SHORTCUT BAR
   ========================================================================== */

/* --- Mobile Sticky Bottom Navigation Bar (Hidden on Desktop/Tablet >=768px) --- */
.mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid rgba(15, 118, 110, 0.14);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.08);
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    justify-content: space-around;
    align-items: center;
}

@media (max-width: 767px) {
    body {
        padding-bottom: 84px !important; /* Safe clearance for page content & footer */
    }

    .mobile-bottom-nav {
        display: flex !important;
    }

    /* Floating WhatsApp Button Clearance on Mobile */
    .whatsapp-float-btn {
        bottom: 88px !important;
        right: 16px !important;
    }
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    color: var(--muted);
    font-size: 0.725rem;
    font-weight: 600;
    text-decoration: none;
    padding: 4px 2px;
    border-radius: 12px;
    position: relative;
    transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease;
    min-height: 44px;
    min-width: 44px;
}

.mobile-nav-item:active {
    transform: scale(0.94);
}

.mobile-nav-item.active {
    color: var(--brand);
    font-weight: 700;
}

.mobile-nav-item.active::before {
    content: '';
    position: absolute;
    top: -8px;
    width: 22px;
    height: 3.5px;
    background: var(--brand);
    border-radius: 4px;
}

.mobile-nav-item .nav-icon {
    width: 22px;
    height: 22px;
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.mobile-nav-item.active .nav-icon {
    transform: translateY(-2px) scale(1.1);
}

/* Floating Center CTA Button */
.mobile-nav-center-cta {
    position: relative;
    top: -14px;
    background: var(--gradient-brand);
    color: #ffffff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(15, 118, 110, 0.4);
    border: 3px solid #ffffff;
    transition: transform 0.2s ease;
    text-decoration: none;
    flex-shrink: 0;
}

.mobile-nav-center-cta:active {
    transform: scale(0.92);
}

/* Mobile Badge on Bottom Cart Shortcut */
.mobile-cart-badge {
    position: absolute;
    top: 2px;
    right: 18%;
    min-width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: var(--danger);
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
}

/* --- Floating WhatsApp Mobile Contact Button --- */
.whatsapp-float-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9990;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--gradient-whatsapp);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.whatsapp-float-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 30px rgba(37, 211, 102, 0.5);
}

.whatsapp-float-btn:active {
    transform: scale(0.94);
}

/* --- Responsive Breakpoints (1280px, 1024px, 768px, 430px, 390px, 375px, 360px, 320px) --- */
@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
}

@media (max-width: 1024px) {
    .desktop-nav {
        display: none !important;
    }

    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        font-size: 1.35rem;
        color: var(--dark, #0f172a);
        padding: 0.4rem;
        cursor: pointer;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .hero-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }

    .hero-visual {
        max-width: 500px;
        margin: 0 auto;
    }

    .services-grid, .why-us-grid, .medicines-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 1.65rem;
    }

    .btn-header-book {
        display: none;
    }

    .hero-title {
        font-size: 2rem !important;
        line-height: 1.25 !important;
    }

    .hero-ctas {
        flex-direction: column;
        width: 100%;
    }

    .hero-ctas .btn {
        width: 100%;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .form-row {
        grid-template-columns: 1fr !important;
    }

    .testimonials-grid, .contact-grid, .store-layout, .cart-layout, .medicines-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Mobile Phones (430px, 390px, 375px) */
@media (max-width: 480px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .medicines-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .logo-text {
        display: block; /* Compact branding on mobile header */
    }

    .logo-title {
        font-size: 0.9rem;
    }

    .logo-subtitle {
        font-size: 0.55rem;
    }

    .cart-drawer {
        max-width: 100%;
    }

    .modal-content {
        padding: 1.5rem;
    }

    .badge-discount, .badge-rx {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }

    .medicine-card-body {
        padding: 0.875rem;
    }

    .medicine-name {
        font-size: 0.875rem;
    }

    .alt-thumbnails-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.5rem !important;
    }
}

/* Smallest Phones (360px & 320px) */
@media (max-width: 360px) {
    .medicines-grid, .services-grid {
        grid-template-columns: 1fr !important;
    }

    .hero-title {
        font-size: 1.55rem !important;
    }

    .section-title {
        font-size: 1.35rem !important;
    }
}

/* --- Store Filters & Mobile Layout Enhancements (< 768px) --- */
@media (max-width: 768px) {
    /* Cart Drawer Mobile Overlay & Footer Clearance */
    .cart-drawer-overlay {
        z-index: 10000 !important;
    }

    .cart-drawer {
        z-index: 10001 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .cart-drawer-footer {
        padding: 1rem !important;
        padding-bottom: calc(88px + env(safe-area-inset-bottom)) !important;
        position: relative !important;
        z-index: 10002 !important;
        background: #ffffff !important;
        border-top: 1px solid var(--border) !important;
        box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05) !important;
    }

    .cart-drawer-btn-row {
        display: flex !important;
        flex-direction: row !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }

    .cart-drawer-btn-row .btn {
        flex: 1 !important;
        width: 50% !important;
        padding: 0.75rem 0.5rem !important;
        font-size: 0.875rem !important;
        text-align: center !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Prevent text overflow and clipping */
    h1, h2, h3, .hero-title, .section-title, .page-header-title, .card-title-sm {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        max-width: 100% !important;
    }

    .page-header-title {
        font-size: 1.6rem !important;
        line-height: 1.3 !important;
    }

    /* Cart Summary Card & Price Row Fixes */
    .cart-summary-card {
        padding: 1rem 0.85rem !important;
        margin-top: 1rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .summary-row, .summary-row-bold {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        gap: 0.5rem !important;
    }

    .summary-row span, .summary-row-bold span {
        word-break: break-word !important;
    }

    /* Login & Account Forms */
    .myaccount-form, .auth-card, .modern-card {
        width: 100% !important;
        max-width: 100% !important;
        padding: 1.25rem 1rem !important;
        box-sizing: border-box !important;
    }

    .store-filter-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
    }

    .store-category-tabs {
        display: flex !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        padding-bottom: 8px !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }

    .store-category-tabs::-webkit-scrollbar {
        display: none !important;
    }

    .category-tab {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    .sort-wrapper {
        justify-content: space-between !important;
        width: 100% !important;
    }

    .sort-select-pill {
        flex: 1 !important;
    }

    .search-box-rel {
        width: 100% !important;
        max-width: 100% !important;
    }

    .product-action-buttons {
        flex-direction: column !important;
        width: 100% !important;
        gap: 0.75rem !important;
    }

    .product-action-buttons .btn {
        width: 100% !important;
    }

    .cart-item-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
    }

    .cart-item-info {
        width: 100% !important;
    }

    .cart-item-price-row {
        justify-content: space-between !important;
        width: 100% !important;
    }
}

/* Header & Logo Mobile Scaling (< 480px) */
@media (max-width: 480px) {
    .container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .logo-img {
        height: 34px !important;
        width: auto !important;
    }

    .header-actions {
        gap: 0.5rem !important;
    }

    .cart-icon-btn {
        padding: 0.35rem !important;
    }

    /* Medicine Cards Single Column Fit on Mobile */
    .medicines-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .medicine-card {
        padding: 0 !important;
    }

    .medicine-card-body {
        padding: 1rem !important;
    }

    .medicine-name {
        font-size: 0.95rem !important;
    }

    .medicine-price {
        font-size: 1.1rem !important;
    }

    .medicine-card-action .btn, 
    .medicine-card-action .card-qty-control {
        font-size: 0.85rem !important;
        padding: 0.5rem 0.75rem !important;
    }
}

/* ==========================================================================
   PRODUCT DETAIL VIEW PAGE MOBILE RESPONSIVENESS ENHANCEMENTS (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
    /* Product Breadcrumb */
    .breadcrumb-list {
        flex-wrap: wrap !important;
        font-size: 0.775rem !important;
        gap: 0.35rem !important;
    }

    /* Product Title & Brand Header */
    .product-main-title {
        font-size: 1.4rem !important;
        line-height: 1.3 !important;
        margin-top: 0.25rem !important;
        margin-bottom: 0.5rem !important;
        word-wrap: break-word !important;
    }

    .product-title-brand {
        font-size: 0.75rem !important;
    }

    .product-spec-text {
        font-size: 0.85rem !important;
        margin-bottom: 0.75rem !important;
    }

    /* Rating Row & Social Share */
    .product-rating-row, 
    .share-icon-box {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        font-size: 0.825rem !important;
        width: 100% !important;
        margin-bottom: 0.75rem !important;
    }

    /* Product Price Box */
    .product-price-box {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: baseline !important;
        gap: 0.65rem !important;
        margin-bottom: 1.25rem !important;
    }

    .product-price-big {
        font-size: 1.65rem !important;
    }

    .product-mrp-cut {
        font-size: 0.95rem !important;
    }

    .product-save-tag {
        font-size: 0.8rem !important;
    }

    /* Product Action Row (Qty Box, Add to Cart, WhatsApp) */
    .product-action-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
        width: 100% !important;
        margin-bottom: 1.5rem !important;
    }

    .qty-control-box {
        width: 100% !important;
        justify-content: center !important;
        max-width: 100% !important;
    }

    .btn-qty-flat {
        padding: 0.6rem 1.25rem !important;
        font-size: 1.1rem !important;
    }

    .qty-val-display {
        font-size: 1.05rem !important;
        width: 3rem !important;
    }

    .product_data,
    .addToCartbtn,
    .btn-whatsapp {
        width: 100% !important;
        display: block !important;
        text-align: center !important;
    }

    .addToCartbtn, 
    .btn-whatsapp {
        padding: 0.75rem 1rem !important;
        font-size: 0.95rem !important;
    }

    /* Gallery & Image Card */
    .product-gallery-card {
        padding: 1.25rem 0.75rem !important;
        margin-bottom: 1rem !important;
        width: 100% !important;
    }

    .zoom-lens-wrap img,
    .zoom-main-img {
        max-height: 210px !important;
        width: 100% !important;
        object-fit: contain !important;
    }

    /* Alternate Image Thumbnails Row */
    .alt-thumbnails-grid,
    .product-thumb-grid {
        display: flex !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        gap: 0.5rem !important;
        padding-bottom: 8px !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }

    .alt-thumbnails-grid::-webkit-scrollbar,
    .product-thumb-grid::-webkit-scrollbar {
        display: none !important;
    }

    .thumb-btn {
        flex: 0 0 68px !important;
        max-width: 68px !important;
        padding: 0.35rem !important;
    }

    .thumb-img {
        height: 48px !important;
        object-fit: contain !important;
    }

    .thumb-label {
        font-size: 0.65rem !important;
    }

    /* Trust Badges Grid */
    .trust-checks-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
        font-size: 0.8rem !important;
        padding-top: 1rem !important;
    }

    /* Overview Tabs & Related Products Carousel */
    .tabs-border-row {
        width: 100% !important;
        overflow-x: auto !important;
    }

    .bg-light-soft {
        padding: 1.25rem 0.85rem !important;
        margin-top: 1.5rem !important;
    }

    .slider-card {
        flex: 0 0 240px !important;
        max-width: 240px !important;
    }
}
