/* Mobile-First Responsive Design for Pinky V Store */

/* Mobile Navigation Enhancements */
@media (max-width: 991.98px) {
    .navbar-nav {
        padding: 1rem 0;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        font-size: 1.1rem;
        border-bottom: 1px solid #f8f9fa;
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
    
    .navbar-collapse {
        margin-top: 1rem;
        background: white;
        border-radius: 8px;
        padding: 1rem;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }
}

/* Mobile Search Overlay */
.mobile-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-search-overlay.show {
    opacity: 1;
    visibility: visible;
}

.mobile-search-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    padding: 2rem 1.5rem;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.mobile-search-overlay.show .mobile-search-container {
    transform: translateY(0);
}

.mobile-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.mobile-search-header h5 {
    color: #333;
    font-weight: 600;
}

.mobile-search-form .form-control {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    font-size: 1rem;
}

.mobile-search-form .form-control:focus {
    border-color: #e91e63;
    box-shadow: 0 0 0 0.2rem rgba(233, 30, 99, 0.25);
}

.mobile-search-form .btn {
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.5rem;
}

.popular-searches {
    margin-top: 2rem;
}

.popular-searches h6 {
    color: #666;
    font-weight: 600;
    margin-bottom: 1rem;
}

.popular-searches .badge {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    border: 1px solid #dee2e6;
}

.popular-searches .badge:hover {
    background-color: #e91e63 !important;
    color: white !important;
    border-color: #e91e63;
}

/* Mobile Hero Section */
@media (max-width: 768px) {
    .hero-banner {
        height: 60vh !important;
        background-attachment: scroll !important;
    }
    
    .hero-banner h1 {
        font-size: 2.2rem !important;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .hero-banner p {
        font-size: 1rem !important;
        margin-bottom: 1.5rem;
    }
    
    .hero-banner .btn {
        font-size: 1rem;
        padding: 0.75rem 2rem;
    }
}

@media (max-width: 576px) {
    .hero-banner {
        height: 50vh !important;
        padding: 2rem 0;
    }
    
    .hero-banner h1 {
        font-size: 1.8rem !important;
    }
    
    .hero-banner .btn {
        width: 100%;
        max-width: 280px;
    }
}

/* Mobile Product Grid */
@media (max-width: 768px) {
    .product-grid .col-lg-3,
    .product-grid .col-md-4,
    .product-grid .col-sm-6 {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 0.5rem;
    }
    
    .product-item {
        margin-bottom: 1rem;
    }
    
    .product-image {
        height: 220px;
        object-fit: cover;
    }
    
    .product-title {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    .product-price {
        font-size: 0.95rem;
        font-weight: 600;
    }
}

@media (max-width: 576px) {
    .product-grid .col-lg-3,
    .product-grid .col-md-4,
    .product-grid .col-sm-6 {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 0.25rem;
    }
    
    .product-item {
        display: flex;
        align-items: center;
        padding: 1rem;
        border: 1px solid #f0f0f0;
        border-radius: 8px;
        margin-bottom: 0.75rem;
    }
    
    .product-image-wrapper {
        flex: 0 0 100px;
        margin-right: 1rem;
    }
    
    .product-image {
        height: 100px;
        width: 100px;
        border-radius: 6px;
    }
    
    .product-info {
        flex: 1;
    }
    
    .product-title {
        font-size: 0.95rem;
        margin-bottom: 0.25rem;
    }
    
    .product-category {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .product-price {
        font-size: 1rem;
        color: #e91e63;
    }
}

/* Mobile Search and Filters */
@media (max-width: 768px) {
    .search-filters {
        position: sticky;
        top: 76px;
        z-index: 1020;
        background: white;
        padding: 1rem;
        border-bottom: 1px solid #dee2e6;
        margin-bottom: 1rem;
    }
    
    .mobile-filter-toggle {
        display: block !important;
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .filters-collapse {
        background: white;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .filter-group {
        margin-bottom: 1.5rem;
    }
    
    .filter-group:last-child {
        margin-bottom: 0;
    }
    
    .form-select, .form-control {
        font-size: 1rem;
        padding: 0.75rem;
    }
}

/* Mobile Category Navigation */
@media (max-width: 768px) {
    .category-nav {
        overflow-x: auto;
        white-space: nowrap;
        padding: 1rem 0;
        -webkit-overflow-scrolling: touch;
    }
    
    .category-nav::-webkit-scrollbar {
        display: none;
    }
    
    .category-item {
        display: inline-block;
        padding: 0.5rem 1rem;
        margin-right: 0.5rem;
        background: #f8f9fa;
        border-radius: 20px;
        font-size: 0.9rem;
        white-space: nowrap;
        border: 1px solid #dee2e6;
    }
    
    .category-item.active,
    .category-item:hover {
        background: #e91e63;
        color: white;
        border-color: #e91e63;
    }
}

/* Mobile Product Detail Page */
@media (max-width: 768px) {
    .product-images {
        margin-bottom: 2rem;
    }
    
    .main-image-container {
        position: relative;
        margin-bottom: 1rem;
    }
    
    .main-image-container img {
        height: 400px !important;
        border-radius: 8px;
    }
    
    .thumbnail-gallery {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .thumbnail-gallery::-webkit-scrollbar {
        display: none;
    }
    
    .thumbnail-gallery .d-flex {
        flex-wrap: nowrap !important;
    }
    
    .thumbnail-img {
        flex: 0 0 auto;
        width: 60px !important;
        height: 60px !important;
        margin-right: 0.5rem;
    }
    
    .product-details h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .price-section h2 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }
    
    .quantity-section {
        margin-bottom: 2rem;
    }
    
    .input-group {
        max-width: 140px !important;
    }
    
    .add-to-cart-form .btn-lg {
        padding: 1rem;
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .main-image-container img {
        height: 350px !important;
    }
    
    .product-details h1 {
        font-size: 1.25rem;
    }
    
    .price-section h2 {
        font-size: 1.5rem;
    }
}

/* Mobile Cart and Checkout */
@media (max-width: 768px) {
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
        border-bottom: 1px solid #dee2e6;
    }
    
    .cart-item-image {
        width: 100%;
        max-width: 120px;
        margin-bottom: 1rem;
    }
    
    .cart-item-details {
        width: 100%;
    }
    
    .cart-item-actions {
        width: 100%;
        margin-top: 1rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .checkout-form .row > div {
        margin-bottom: 1rem;
    }
    
    .checkout-summary {
        position: sticky;
        top: 76px;
        background: white;
        padding: 1.5rem;
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        margin-bottom: 2rem;
    }
}

/* Mobile Touch Improvements */
@media (max-width: 768px) {
    /* Larger touch targets */
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
    }
    
    .btn-sm {
        min-height: 36px;
        padding: 0.5rem 1rem;
    }
    
    .form-control, .form-select {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Better spacing for touch */
    .list-group-item {
        padding: 1rem;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
    }
    
    /* Improved modal experience */
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-footer {
        padding: 1rem 1.5rem;
    }
}

/* Mobile Horizontal Scrolling Sections */
@media (max-width: 768px) {
    .horizontal-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .horizontal-scroll::-webkit-scrollbar {
        display: none;
    }
    
    .scroll-container {
        display: flex;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .scroll-item {
        flex: 0 0 auto;
        width: 250px;
    }
    
    /* Navigation arrows hidden on mobile */
    .scroll-nav {
        display: none !important;
    }
}

/* Mobile Footer */
@media (max-width: 768px) {
    .footer {
        text-align: center;
    }
    
    .footer .row > div {
        margin-bottom: 2rem;
    }
    
    .footer h5 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .footer .list-unstyled li {
        margin-bottom: 0.5rem;
    }
    
    .footer .list-unstyled a {
        font-size: 0.95rem;
        padding: 0.25rem 0;
        display: inline-block;
    }
}

/* Mobile Typography */
@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    
    .lead {
        font-size: 1.1rem;
    }
    
    .text-lg {
        font-size: 1rem !important;
    }
}

/* Mobile Loading States */
@media (max-width: 768px) {
    .loading-spinner {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 9999;
    }
    
    .skeleton-loader {
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: loading 1.5s infinite;
    }
    
    @keyframes loading {
        0% { background-position: 200% 0; }
        100% { background-position: -200% 0; }
    }
}

/* Mobile Accessibility */
@media (max-width: 768px) {
    .sr-only-mobile {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }
    
    .focus-visible {
        outline: 2px solid #e91e63 !important;
        outline-offset: 2px !important;
    }
}

/* Mobile Gestures and Interactions */
@media (max-width: 768px) {
    .swipe-indicator {
        position: absolute;
        bottom: 1rem;
        left: 50%;
        transform: translateX(-50%);
        color: rgba(255, 255, 255, 0.8);
        font-size: 0.8rem;
        opacity: 0;
        animation: fadeInOut 3s ease-in-out infinite;
    }
    
    @keyframes fadeInOut {
        0%, 100% { opacity: 0; }
        50% { opacity: 1; }
    }
    
    .pull-to-refresh {
        padding: 2rem 0;
        text-align: center;
        color: #6c757d;
        font-size: 0.9rem;
    }
}

/* Dark mode support for mobile */
@media (max-width: 768px) and (prefers-color-scheme: dark) {
    .navbar {
        background-color: #2c2c2c !important;
    }
    
    .navbar-nav .nav-link {
        color: #f8f9fa !important;
        border-bottom-color: #404040;
    }
    
    .search-filters {
        background-color: #2c2c2c;
        color: #f8f9fa;
    }
    
    .filters-collapse {
        background-color: #343a40;
        border-color: #495057;
    }
    
    .product-item {
        background-color: #343a40;
        border-color: #495057;
        color: #f8f9fa;
    }
}