/* Mobile Fixes for Asba Life Care E-commerce */

/* ============================================
   1. Wishlist Page - Fix Image Overflow on Mobile
   ============================================ */
.pa-wishlist-page .product-card {
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.pa-wishlist-page .product-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    position: relative;
    background-color: #f5f5f5;
}

.pa-wishlist-page .product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

@media (max-width: 767px) {
    .pa-wishlist-page .product-image {
        height: 200px;
    }

    .pa-wishlist-page .product-card {
        margin-bottom: 15px;
    }
}


/* ============================================
   3. Shop Page - Always Show Product Elements (No Hover)
   ============================================ */
.pa-product-box .pa-product-cart {
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    margin-top: 15px;
    bottom: auto !important;
}

.pa-product-box .pa-product-cart ul {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.pa-product-box:hover .pa-product-cart {
    bottom: auto !important;
}

.pa-product-shop .pa-product-box p.pa-product-rating {
    display: none !important;
}

.pa-product-box .pa-product-content {
    padding-top: 15px;
}

.pa-product-box {
    padding: 0px;
    overflow: hidden;
}

/* ============================================
   4. Quantity Increment Fix - Product Single Page
   ============================================ */
/* JavaScript will handle this, but ensure input styling is correct */
.pa-cart-quantity input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.pa-cart-quantity input[type="number"]::-webkit-inner-spin-button,
.pa-cart-quantity input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ============================================
   5. Founder Section Enhancement
   ============================================ */
.founder-section {
    background: linear-gradient(135deg, #0b5b63 0%, #1f8457 100%);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.founder-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="10" cy="10" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="30" cy="30" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="15" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="70" cy="40" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="85" cy="20" r="1" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    opacity: 0.3;
    z-index: 1;
}

.founder-content {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.95);
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 900px;
    margin: 0 auto;
}

.founder-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #0b5b63;
    margin-bottom: 25px;
    text-align: center;
    position: relative;
    padding-bottom: 20px;
}

.founder-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #86c440, #0b5b63);
    border-radius: 2px;
}

.founder-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #173439;
    text-align: center;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .founder-section {
        padding: 50px 0;
    }

    .founder-content {
        padding: 30px 20px;
        border-radius: 15px;
    }

    .founder-title {
        font-size: 1.8rem;
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .founder-title::after {
        width: 70px;
        height: 3px;
    }

    .founder-text {
        font-size: 1rem;
        line-height: 1.7;
    }
}


/* ============================================
   Additional Mobile Optimizations
   ============================================ */

/* Prevent horizontal scroll on all pages */
body {
    overflow-x: hidden;
}


/* Responsive images */
img {
    max-width: 100%;
    height: auto;
}

/* Fix for product cards in grid */
@media (max-width: 767px) {
    .pa-product-box {
        margin-bottom: 20px;
    }

    .pa-product-content h4 {
        font-size: 08.rem;
        line-height: 1.4;
        margin-bottom: 8px;
    }

    .pa-product-content p {
        font-size: 13px;
    }
}

/* ============================================
   7. Mobile Sidebar Navigation - Complete Solution
   ============================================ */
.mobile-sidebar-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Sidebar Header */
.mobile-sidebar-header {
    padding: 20px 12px;
    background: #014940;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mobile-sidebar-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

@media (max-width: 991.98px) {

    /* Hide default navbar on mobile */
    .pa-nav-bar .pa-menu {
        display: none !important;
    }

    /* Mobile Sidebar Overlay */
    .mobile-sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        opacity: 0;
        visibility: visible;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .mobile-sidebar-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    /* Mobile Sidebar Container */
    .mobile-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: #fff;
        z-index: 99999;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .mobile-sidebar.active {
        transform: translateX(0);
    }

    .mobile-sidebar-close:hover {
        transform: rotate(90deg);
    }

    /* Sidebar Menu */
    .mobile-sidebar-menu {
        padding: 0;
        margin: 0;
        list-style: none;
    }

    .mobile-sidebar-menu li {
        border-bottom: 1px solid #f0f0f0;
    }

    .mobile-sidebar-menu li a {
        display: block;
        padding: 16px 20px;
        color: #333;
        text-decoration: none;
        font-size: 16px;
        font-weight: 500;
        transition: background-color 0.2s ease, color 0.2s ease;
    }

    .mobile-sidebar-menu li a:hover,
    .mobile-sidebar-menu li a:active {
        background: #f8f9fa;
        color: #0b5b63;
    }
}

@media (max-width: 991.98px) {

    /* User Section in Sidebar */
    .mobile-sidebar-user {
        padding: 20px;
        background: #f8f9fa;
        border-bottom: 1px solid #e0e0e0;
    }

    .mobile-sidebar-user h4 {
        margin: 0 0 15px 0;
        font-size: 14px;
        color: #666;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .mobile-sidebar-user-menu {
        padding: 0;
        margin: 0;
        list-style: none;
    }

    .mobile-sidebar-user-menu li {
        border-bottom: none;
    }

    .mobile-sidebar-user-menu li a {
        padding: 12px 0;
        color: #333;
        font-size: 15px;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .mobile-sidebar-user-menu li a i {
        width: 20px;
        color: #0b5b63;
    }

    /* Toggle Button Enhancement */
    .pa-toggle-nav {
        display: flex;
        flex-direction: column;
        gap: 2px;
        cursor: pointer;
        padding: 8px;
        z-index: 10001;
        position: relative;
    }

    .pa-toggle-nav span {
        width: 25px;
        height: 3px;
        background: #fff;
        border-radius: 2px;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .pa-toggle-nav.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .pa-toggle-nav.active span:nth-child(2) {
        opacity: 0;
    }

    .pa-toggle-nav.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    /* Prevent body scroll when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
    }

    /* Ensure header stays fixed properly on mobile */

    .pa-main-header.is-sticky {
        position: sticky !important;
        top: 0 !important;
        z-index: 1097 !important;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
    }

    /* Smooth scrolling for sidebar */
    .mobile-sidebar {
        -webkit-overflow-scrolling: touch;
    }

    /* Badge styling in sidebar */
    .mobile-sidebar-menu .badge {
        margin-left: 8px;
        font-size: 12px;
        padding: 3px 8px;
        border-radius: 12px;
    }

    /* Icon spacing in user menu */
    .mobile-sidebar-user-menu i {
        font-size: 14px;
    }

    /* Active menu item */
    .mobile-sidebar-menu li a.active {
        background: #0b5b63;
        color: #fff !important;
    }
}

/* ============================================
   Device-Specific Responsive Fixes
   ============================================ */

/* Extra Small Devices (iPhone SE, Galaxy Fold) - 320px */
@media (max-width: 374px) {
    .mobile-sidebar {
        width: 90%;
        max-width: 280px;
    }

    .pa-head-icon ul li {
        margin-left: 8px !important;
    }

    .pa-head-icon svg {
        width: 20px !important;
        height: 20px !important;
    }

    .mobile-sidebar-header h3 {
        font-size: 16px;
    }

    .mobile-sidebar-menu li a {
        font-size: 15px;
        padding: 14px 16px;
    }
}

/* Small Mobile Devices (iPhone 12/13/14, Galaxy S) - 375px to 413px */
@media (min-width: 375px) and (max-width: 413px) {
    .mobile-sidebar {
        width: 85%;
        max-width: 300px;
    }

    .pa-toggle-nav span {
        width: 24px;
    }
}

/* Medium Mobile Devices (iPhone Pro Max, Pixel) - 414px to 767px */
@media (min-width: 414px) and (max-width: 767px) {
    .mobile-sidebar {
        width: 80%;
        max-width: 320px;
    }

    .mobile-sidebar-menu li a {
        font-size: 16px;
    }
}

/* Tablet Devices (iPad Mini, Small Tablets) - 768px to 991px */
@media (min-width: 768px) and (max-width: 991px) {
    .mobile-sidebar {
        width: 60%;
        max-width: 380px;
    }

    .mobile-sidebar-header {
        padding: 25px;
    }

    .mobile-sidebar-header h3 {
        font-size: 20px;
    }

    .mobile-sidebar-menu li a {
        font-size: 17px;
        padding: 18px 25px;
    }

    .mobile-sidebar-user {
        padding: 0px 25px;
    }
}

/* ============================================
   8. Fix User Dropdown on All Pages
   ============================================ */
/* Universal header overflow fix for dropdown */
.pa-main-header,
.pa-top-header,
header {
    overflow: visible !important;
}

.pa-head-icon .dropdown-menu {
    position: absolute !important;
    z-index: 1099 !important;
}

/* Ensure dropdown works properly without scroll issues */
.pa-head-icon .dropdown {
    position: static !important;
}

.pa-head-icon .dropdown-menu {
    position: absolute !important;
    right: 0 !important;
    left: auto !important;
}



/* ============================================
   9. Fix Wishlist Page Empty State
   ============================================ */
.pa-wishlist-page .empty-state {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   10. Additional Cart Page Fixes
   ============================================ */
.cart-item img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

@media (max-width: 767px) {
    .cart-item .col-2 {
        flex: 0 0 20%;
        max-width: 20%;
    }

    .cart-item .col-4 {
        flex: 0 0 35%;
        max-width: 35%;
    }

    .cart-item .col-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }

    .cart-item .col-2.text-center {
        flex: 0 0 15%;
        max-width: 15%;
        font-size: 0.9rem;
    }

    .cart-item .col-1 {
        flex: 0 0 5%;
        max-width: 5%;
    }
}

/* ============================================
   11. Toast Notification Styling
   ============================================ */
.toast-container {
    z-index: 9999 !important;
}

.toast {
    min-width: 250px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3);
}

.toast-body {
    font-size: 0.95rem;
    padding: 0.75rem;
}

.toast.bg-success {
    background-color: #28a745 !important;
}

.toast.bg-danger {
    background-color: #dc3545 !important;
}

.toast.bg-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

@media (max-width: 767px) {
    .toast-container {
        top: 10px !important;
        right: 10px !important;
        left: 10px !important;
        padding: 0 !important;
    }

    .toast {
        width: 100% !important;
        max-width: none !important;
    }

}

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

    body.sidebar-open {
        overflow: auto !important;
    }
}
