/**
 * ISSOU COLLECTIONS - Responsive Styles
 * Mobile-First Responsive Design
 */

/* ========== Fix Hero White Space ========== */

/* Pages without hero need padding for fixed nav */
.main-content {
    padding-top: 70px;
}

/* Homepage - no padding, hero handles it */
.main-content.homepage {
    padding-top: 0 !important;
}

@media (max-width: 768px) {
    .main-content {
        padding-top: 60px;
        padding-bottom: 80px; /* For mobile bottom nav */
    }
    
    .main-content.homepage {
        padding-top: 0 !important;
    }
}

/* ========== Hero Mobile Improvements ========== */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 100px 20px 40px;
    position: relative;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    z-index: 10;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    background: rgba(255,255,255,0.95);
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.hero-badge-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.hero-logo {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 15vw, 8rem);
    font-weight: 400;
    letter-spacing: 0.15em;
    color: var(--black);
    margin-bottom: 10px;
    line-height: 1;
}

.hero-tagline {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    font-style: italic;
    color: var(--gray-700);
    margin-bottom: 20px;
}

.hero-desc {
    font-size: clamp(0.9rem, 3vw, 1rem);
    color: var(--gray-600);
    line-height: 1.7;
    max-width: 450px;
    margin: 0 auto 35px;
    padding: 0 10px;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    width: 100%;
    padding: 0 10px;
}

/* Hide scroll indicator on mobile */
.hero-scroll {
    position: absolute;
    bottom: 30px;
    right: 30px;
}

@media (max-width: 768px) {
    .hero {
        min-height: calc(100vh - 60px);
        min-height: calc(100dvh - 60px);
        padding: 90px 20px 100px;
        justify-content: flex-start;
        padding-top: 100px;
    }
    
    .hero-content {
        padding-top: 20px;
    }
    
    .hero-badge {
        font-size: 0.6rem;
        padding: 8px 18px;
        margin-bottom: 25px;
    }
    
    .hero-logo {
        font-size: 4rem;
        margin-bottom: 8px;
    }
    
    .hero-tagline {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .hero-desc {
        font-size: 0.9rem;
        margin-bottom: 30px;
        line-height: 1.6;
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .hero-cta .btn {
        width: 100%;
        justify-content: center;
        padding: 16px 24px;
        font-size: 0.75rem;
    }
    
    .hero-scroll,
    .hide-mobile {
        display: none !important;
    }
}

@media (max-width: 380px) {
    .hero {
        padding: 85px 15px 90px;
    }
    
    .hero-logo {
        font-size: 3.2rem;
    }
    
    .hero-tagline {
        font-size: 1rem;
    }
    
    .hero-desc {
        font-size: 0.85rem;
    }
    
    .hero-badge {
        font-size: 0.55rem;
        padding: 7px 14px;
    }
}

/* ========== Category Carousel ========== */
#carouselTrack {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#carouselTrack::-webkit-scrollbar {
    display: none;
}

.cat-slide {
    -webkit-tap-highlight-color: transparent;
}

.cat-slide:active {
    transform: scale(0.97) !important;
}

.cat-slide:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 40px rgba(0,0,0,0.18) !important;
}

/* Desktop override for grid layout */
@media (min-width: 768px) {
    #categoryCarousel {
        padding: 10px 20px 30px !important;
    }
    
    #carouselTrack {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
        overflow: visible !important;
        padding: 0 !important;
        max-width: 900px;
        margin: 0 auto;
    }
    
    #carouselTrack .cat-slide {
        flex: none !important;
        height: 320px !important;
    }
    
    #carouselDots {
        display: none !important;
    }
}

@media (min-width: 1024px) {
    #carouselTrack {
        grid-template-columns: repeat(4, 1fr) !important;
        max-width: 1200px;
    }
    
    #carouselTrack .cat-slide {
        height: 350px !important;
    }
}

/* ========== Section Styling ========== */
.section {
    padding: 60px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 10px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 500;
    color: var(--black);
    margin-bottom: 10px;
}

.section-desc {
    font-size: 0.95rem;
    color: var(--gray-500);
    max-width: 500px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .section {
        padding: 40px 0;
    }
    
    .section-header {
        margin-bottom: 25px;
        padding: 0 10px;
    }
    
    .section-label {
        font-size: 0.65rem;
    }
    
    .section-desc {
        font-size: 0.9rem;
    }
}

/* ========== Mobile First Base (< 480px) ========== */
@media (max-width: 480px) {
    /* Container */
    .container {
        padding: 0 15px;
    }
    
    /* Typography */
    body {
        font-size: 14px;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    /* Navigation */
    .nav-container {
        padding: 0 15px;
    }
    
    .nav-logo {
        font-size: 1.3rem;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
    }
    
    .nav-actions {
        gap: 2px;
    }
    
    /* Hero Section */
    .hero {
        min-height: 70vh;
        padding: 100px 0 60px;
    }
    
    .hero-title {
        font-size: 2rem !important;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        padding: 0 10px;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        padding: 0 20px;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    /* Product Grid */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .product-card {
        border-radius: 12px;
    }
    
    .product-card-name {
        font-size: 0.85rem;
    }
    
    .product-card-price {
        font-size: 0.9rem;
    }
    
    .product-card-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .product-card-actions .btn {
        width: 100%;
        padding: 10px;
        font-size: 0.7rem;
    }
    
    /* Section Headers */
    .section-header {
        margin-bottom: 30px;
        padding: 0 10px;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .section-subtitle {
        font-size: 0.85rem;
    }
    
    /* Page Header */
    .page-header {
        padding: 40px 0 30px;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
    
    /* Buttons */
    .btn {
        padding: 12px 24px;
        font-size: 0.75rem;
    }
    
    .btn-lg {
        padding: 14px 28px;
        font-size: 0.8rem;
    }
    
    /* Cart Sidebar */
    .cart-sidebar {
        max-width: 100%;
    }
    
    .cart-item {
        gap: 10px;
    }
    
    .cart-item-image {
        width: 60px;
        height: 75px;
    }
    
    .cart-item-name {
        font-size: 0.9rem;
    }
    
    /* Checkout */
    .checkout-container {
        padding: 20px 15px;
    }
    
    .checkout-section {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .checkout-summary {
        padding: 20px 15px;
    }
    
    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 12px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Product Detail */
    .product-detail {
        padding: 20px 0;
    }
    
    .product-gallery {
        margin-bottom: 30px;
    }
    
    .product-info {
        padding: 0 15px;
    }
    
    .product-title {
        font-size: 1.5rem;
    }
    
    .product-price {
        font-size: 1.5rem;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .feature-item span {
        font-size: 0.75rem;
    }
    
    /* Mobile Bottom Nav */
    .mobile-nav {
        padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
    }
    
    .mobile-nav-item {
        font-size: 0.6rem;
    }
    
    .mobile-nav-item svg {
        width: 20px;
        height: 20px;
    }
    
    /* Breadcrumb */
    .breadcrumb {
        font-size: 0.75rem;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    /* Alerts */
    .alert {
        padding: 12px 15px;
        font-size: 0.85rem;
    }
    
    /* Modals */
    .modal-content {
        margin: 10px;
        max-height: 90vh;
    }
    
    /* Filters */
    .filters-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-select {
        width: 100%;
    }
    
    /* Toast */
    .toast-container {
        left: 10px;
        right: 10px;
        top: auto;
        bottom: 80px;
    }
    
    .toast {
        padding: 12px 16px;
    }
    
    /* Categories Grid */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .category-card {
        height: 150px;
    }
    
    .category-name {
        font-size: 1rem;
    }
    
    /* Contact Page */
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-info {
        order: 2;
    }
    
    .contact-form {
        order: 1;
    }
    
    /* About Page */
    .about-content {
        padding: 0 15px;
    }
    
    .about-image {
        height: 250px;
    }
    
    /* Tracking Pages */
    .tracking-container {
        padding: 20px 15px;
    }
    
    .tracking-timeline {
        padding-left: 30px;
    }
    
    .timeline-step {
        padding-left: 20px;
    }
}

/* ========== Small Tablets (481px - 768px) ========== */
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
    
    /* Hero */
    .hero {
        min-height: 75vh;
    }
    
    .hero-title {
        font-size: 2.5rem !important;
    }
    
    .hero-buttons {
        flex-direction: row;
        justify-content: center;
    }
    
    /* Product Grid */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    /* Categories */
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    /* Forms */
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== Tablets (769px - 1024px) ========== */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Navigation */
    .nav-menu {
        display: none;
    }
    
    .nav-hamburger {
        display: flex;
    }
    
    /* Hero */
    .hero-title {
        font-size: 3rem !important;
    }
    
    /* Product Grid */
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
    
    /* Product Detail - Side by Side */
    .product-detail-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Features */
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Checkout */
    .checkout-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== Desktop (1025px+) ========== */
@media (min-width: 1025px) {
    /* Navigation */
    .nav-menu {
        display: flex;
    }
    
    .nav-hamburger {
        display: none;
    }
    
    /* Mobile Nav Hidden */
    .mobile-nav {
        display: none !important;
    }
    
    .main-content {
        padding-bottom: 0;
    }
    
    /* Product Grid */
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Product Detail */
    .product-detail-grid {
        grid-template-columns: 1fr 1fr;
        gap: 60px;
    }
    
    /* Checkout */
    .checkout-grid {
        grid-template-columns: 1fr 400px;
        gap: 40px;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1.5fr;
    }
}

/* ========== Large Desktop (1400px+) ========== */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
    
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 35px;
    }
}

/* ========== Touch Device Optimizations ========== */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn {
        min-height: 48px;
    }
    
    .nav-btn {
        min-width: 48px;
        min-height: 48px;
    }
    
    .form-input,
    .form-select {
        min-height: 48px;
    }
    
    /* Remove hover effects on touch */
    .product-card:hover {
        transform: none;
    }
    
    .btn-primary:hover {
        transform: none;
    }
    
    /* Product card quick actions always visible */
    .product-card-overlay {
        opacity: 1;
    }
}

/* ========== Landscape Mode ========== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: 80px 0 40px;
    }
    
    .hero-title {
        font-size: 2rem !important;
    }
    
    .mobile-menu {
        overflow-y: auto;
    }
}

/* ========== High DPI Screens ========== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Sharper borders */
    .product-card,
    .btn,
    .form-input {
        border-width: 0.5px;
    }
}

/* ========== Dark Mode Support (Optional) ========== */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode
    :root {
        --white: #1a1a1a;
        --black: #ffffff;
        --gray-100: #2d2d2d;
        --gray-200: #3d3d3d;
        --cream: #242424;
    }
    */
}

/* ========== Reduced Motion ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* ========== Print Styles ========== */
@media print {
    .nav,
    .mobile-nav,
    .mobile-menu,
    .cart-sidebar,
    .search-overlay,
    .toast-container,
    .footer {
        display: none !important;
    }
    
    .main-content {
        padding: 0;
    }
    
    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .product-card {
        break-inside: avoid;
    }
}

/* ========== Safe Area Insets (iPhone X+) ========== */
@supports (padding: max(0px)) {
    .mobile-nav {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
    
    .cart-sidebar,
    .mobile-menu {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .container {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }
}

/* ========== Specific Component Fixes ========== */

/* Fix iOS input zoom */
@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Fix 100vh on mobile */
.hero,
.mobile-menu,
.cart-sidebar {
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height */
}

/* Sticky elements fix */
@supports (position: sticky) {
    .nav {
        position: sticky;
        top: 0;
    }
}

/* Flexbox gap fallback */
@supports not (gap: 1rem) {
    .products-grid > * {
        margin: 10px;
    }
    
    .nav-actions > * {
        margin-left: 5px;
    }
}

/* ========== Utility Classes for Responsive ========== */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    
    .show-mobile {
        display: block !important;
    }
}

.hide-tablet {
    display: block;
}

.show-tablet {
    display: none;
}

@media (min-width: 769px) and (max-width: 1024px) {
    .hide-tablet {
        display: none !important;
    }
    
    .show-tablet {
        display: block !important;
    }
}

.hide-desktop {
    display: block;
}

.show-desktop {
    display: none;
}

@media (min-width: 1025px) {
    .hide-desktop {
        display: none !important;
    }
    
    .show-desktop {
        display: block !important;
    }
}

/* Text alignment responsive */
@media (max-width: 768px) {
    .text-center-mobile {
        text-align: center !important;
    }
    
    .text-left-mobile {
        text-align: left !important;
    }
}

/* Spacing responsive */
@media (max-width: 768px) {
    .section {
        padding: 40px 0;
    }
    
    .py-mobile-sm {
        padding-top: 20px !important;
        padding-bottom: 20px !important;
    }
}