/* Mobile-First Optimizations */

/* ===== TOUCH TARGETS ===== */
/* Ensure all interactive elements are minimum 44x44px */
.btn,
button,
a.btn {
    min-height: 44px;
    min-width: 44px;
    padding: 0.75rem 1.5rem;
}

.icon-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Product card buttons */
.wishlist-btn,
.quick-view-btn {
    width: 44px;
    height: 44px;
}

/* ===== MOBILE TYPOGRAPHY ===== */
/* Ensure readable text without zooming */
@media (max-width: 768px) {
    body {
        font-size: 16px;
        /* Minimum for mobile */
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    h4 {
        font-size: 1.25rem;
    }

    /* Product prices */
    .product-price {
        font-size: 1.125rem;
    }
}

/* ===== PREVENT HORIZONTAL SCROLL ===== */
html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}

* {
    max-width: 100%;
}

/* ===== MOBILE STICKY CART ===== */
.mobile-sticky-cart {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1rem;
    z-index: 90;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.mobile-sticky-cart.visible {
    transform: translateY(0);
}

@media (min-width: 768px) {
    .mobile-sticky-cart {
        display: none;
    }
}

/* ===== MOBILE FORMS ===== */
@media (max-width: 768px) {

    input,
    textarea,
    select {
        font-size: 16px;
        /* Prevents zoom on iOS */
        min-height: 44px;
    }

    input[type="checkbox"],
    input[type="radio"] {
        width: 24px;
        height: 24px;
    }
}

/* ===== MOBILE SPACING ===== */
@media (max-width: 768px) {
    .container-custom {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Reduce spacing on mobile */
    .section-padding {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}

/* ===== MOBILE NAVIGATION ===== */
@media (max-width: 768px) {

    /* Ensure nav items are easily tappable */
    nav a {
        padding: 0.75rem 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* ===== LOADING OVERLAY ===== */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#loading-overlay .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #C9A961;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== MOBILE PRODUCT GALLERY ===== */
@media (max-width: 768px) {
    .product-gallery {
        touch-action: pan-x;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .product-gallery img {
        scroll-snap-align: center;
    }
}

/* ===== SCROLLING & MOMENTUM ===== */
* {
    -webkit-overflow-scrolling: touch;
    /* Momentum scroll for iOS */
}

.overflow-y-auto {
    overscroll-behavior: contain;
    /* Prevent body scroll chaining */
}

/* ===== FOCUS STYLES ===== */
*:focus-visible {
    outline: 2px solid #C9A961;
    outline-offset: 2px;
}

/* ===== SKELETON LOADERS ===== */
.skeleton {
    background: linear-gradient(90deg,
            #f0f0f0 25%,
            #e0e0e0 50%,
            #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ===== NOTIFICATION SYSTEM ===== */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    transform: translateX(calc(100% + 2rem));
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid #10b981;
}

.notification.error {
    border-left: 4px solid #ef4444;
}

.notification.info {
    border-left: 4px solid #3b82f6;
}

@media (max-width: 768px) {
    .notification {
        left: 1rem;
        right: 1rem;
        min-width: auto;
    }
}

/* ===== EMPTY STATES ===== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    opacity: 0.2;
}

/* ===== RESPONSIVE IMAGES ===== */
img {
    max-width: 100%;
    height: auto;
}

img[loading="lazy"] {
    background: #f0f0f0;
}