/**
 * Mobile Optimization CSS
 * Complete mobile responsiveness for all pages
 */

/* ============================================
   Base Mobile Optimizations
   ============================================ */

/* Ensure proper viewport behavior */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Better touch targets */
button,
a.btn,
.btn-icon,
.btn-cart,
input[type="submit"],
input[type="button"] {
    min-height: 44px;
    min-width: 44px;
}

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
}

/* ============================================
   Tablet and Small Desktop (max-width: 968px)
   ============================================ */
@media (max-width: 968px) {
    /* Hide desktop navigation, show mobile toggle */
    .main-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    /* Header adjustments */
    .header-search {
        max-width: 300px;
    }

    .logo a span {
        font-size: 1.2rem;
    }

    .logo i {
        font-size: 1.5rem;
    }

    /* Cart and checkout layouts to single column */
    .cart-layout,
    .checkout-layout {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }

    .cart-summary,
    .order-summary {
        position: static !important;
        top: auto !important;
        max-width: 100%;
    }

    /* Hero section */
    .hero {
        padding: 3rem 0;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }
}

/* ============================================
   Desktop/Laptop Optimizations (min-width: 1200px)
   ============================================ */
@media (min-width: 1200px) {
    /* Wider containers on large screens */
    .container {
        max-width: 1400px;
    }

    /* Better use of space for cart/checkout layouts */
    .cart-layout,
    .checkout-layout {
        grid-template-columns: 1fr 450px;
        gap: 4rem;
    }

    /* Product details with more room */
    .product-details .container {
        grid-template-columns: 1fr 450px;
        gap: 4rem;
    }

    /* Wider summaries for better readability */
    .cart-summary,
    .order-summary,
    .packages-section {
        padding: 2.5rem;
    }

    /* Homepage sections - better spacing */
    .hero-home,
    .features,
    .categories,
    .testimonials,
    .how-it-works,
    .guarantees,
    .platforms-section {
        padding: 6rem 0;
    }

    /* Wider grids on large screens */
    .testimonials-grid,
    .features-grid,
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem;
    }
}

/* ============================================
   Mobile Devices (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    /* Container padding - compact */
    .container {
        padding: 0 12px;
    }

    /* Typography scaling - more compact */
    h1 {
        font-size: 1.5rem;
        line-height: 1.2;
        margin-bottom: 0.75rem;
    }

    h2 {
        font-size: 1.3rem;
        line-height: 1.2;
        margin-bottom: 0.75rem;
    }

    h3 {
        font-size: 1.15rem;
        line-height: 1.2;
        margin-bottom: 0.5rem;
    }

    /* Reduce paragraph spacing */
    p {
        margin-bottom: 0.75rem;
        line-height: 1.4;
    }

    /* Header improvements */
    .header-content {
        flex-wrap: wrap;
        padding: 0.75rem 0;
    }

    .header-top-bar {
        flex-direction: column;
        gap: 8px;
        padding: 8px 0;
        text-align: center;
    }

    .header-top-links {
        font-size: 0.85rem;
    }

    .live-visitor-counter {
        font-size: 0.85rem;
    }

    .header-search {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin-top: 10px;
    }

    .search-input {
        font-size: 14px;
        padding: 10px 12px;
    }

    .header-actions {
        gap: 0.5rem;
    }

    .header-actions .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    /* IMPORTANT: Keep checkout progress HORIZONTAL on mobile (override revenue-optimizations.css) */
    .checkout-progress {
        flex-direction: row !important;
        flex-wrap: nowrap;
        gap: 0.5rem !important;
        padding: 1rem 0.75rem !important;
        margin-bottom: 1rem !important;
    }

    .checkout-progress .progress-step {
        flex-direction: column;
        align-items: center;
        font-size: 0.75rem;
        gap: 0.25rem;
    }

    .checkout-progress .step-number {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.75rem !important;
    }

    .checkout-progress .progress-divider {
        width: 20px !important;
        height: 2px !important;
        transform: none !important;
        margin: 0 !important;
    }

    /* ========================================
       HOMEPAGE SECTIONS - COMPACT
       ======================================== */

    /* Hero home section */
    .hero-home {
        padding: 2rem 0 !important;
        margin-bottom: 1.5rem;
    }

    .hero-home-content {
        padding: 1rem 0;
    }

    .hero-home-title {
        font-size: 1.5rem !important;
        line-height: 1.2;
        margin-bottom: 0.75rem;
    }

    .highlight-text {
        display: inline;
    }

    .hero-home-subtitle {
        font-size: 0.9rem !important;
        line-height: 1.4;
        margin-bottom: 1rem;
    }

    .hero-cta-buttons {
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .btn-hero-primary,
    .btn-hero-secondary {
        padding: 0.75rem 1.25rem !important;
        font-size: 0.9rem !important;
        width: 100%;
    }

    .hero-trust-row {
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1rem;
    }

    .trust-item-small {
        font-size: 0.8rem;
        justify-content: center;
    }

    .trust-badge-floating {
        font-size: 0.8rem !important;
        padding: 0.5rem 0.75rem !important;
        margin-bottom: 1rem;
    }

    .hero-right {
        margin-top: 1.5rem;
    }

    .hero-visual-card {
        padding: 1rem;
    }

    .stats-display {
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .stat-item-hero {
        padding: 0.75rem;
    }

    .stat-icon-hero {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .stat-content-hero strong {
        font-size: 1.1rem;
    }

    .stat-content-hero span {
        font-size: 0.75rem;
    }

    .platforms-preview {
        gap: 0.5rem;
    }

    .platform-icon-preview {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    /* Results proof section */
    .results-proof-section {
        padding: 2rem 0 !important;
        margin: 1.5rem 0 !important;
    }

    .results-proof-section h2 {
        font-size: 1.5rem !important;
        margin-bottom: 0.75rem !important;
    }

    .results-proof-section p {
        font-size: 0.9rem !important;
        margin-bottom: 1.5rem !important;
    }

    /* Features section */
    .features {
        padding: 2rem 0 !important;
    }

    .features .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .features-grid {
        gap: 1rem;
    }

    .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }

    /* Categories section */
    .categories {
        padding: 2rem 0 !important;
    }

    .categories .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    /* Platforms section */
    .platforms-section {
        padding: 2rem 0 !important;
    }

    .platforms-grid {
        gap: 1rem;
    }

    .platform-card {
        padding: 1rem;
    }

    .platform-card h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .platform-card p {
        font-size: 0.85rem;
    }

    /* How it works section */
    .how-it-works {
        padding: 2rem 0 !important;
    }

    .steps-grid {
        gap: 1rem;
    }

    .step-card {
        padding: 1rem;
    }

    .step-number {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }

    .step-card h3 {
        font-size: 1.05rem;
        margin-bottom: 0.5rem;
    }

    .step-card p {
        font-size: 0.85rem;
    }

    /* Testimonials section */
    .testimonials {
        padding: 2rem 0 !important;
    }

    .testimonials .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .testimonials-grid {
        gap: 1rem;
    }

    .testimonial-card {
        padding: 1rem;
    }

    .testimonial-header {
        margin-bottom: 0.75rem;
    }

    .testimonial-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .testimonial-name {
        font-size: 0.95rem;
    }

    .testimonial-role {
        font-size: 0.75rem;
    }

    .testimonial-rating i {
        font-size: 0.8rem;
    }

    .testimonial-text {
        font-size: 0.85rem;
        line-height: 1.4;
    }

    /* Guarantees section */
    .guarantees,
    .guarantees-section {
        padding: 2rem 0 !important;
    }

    .guarantees-grid {
        gap: 1rem;
    }

    .guarantee-card {
        padding: 1rem;
    }

    .guarantee-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .guarantee-card h3 {
        font-size: 1.05rem;
        margin-bottom: 0.5rem;
    }

    .guarantee-card p {
        font-size: 0.85rem;
    }

    /* Final CTA section */
    .final-cta {
        padding: 2rem 0 !important;
    }

    .final-cta h2 {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .final-cta p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .final-cta .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }

    /* Hero section (generic) - more compact */
    .hero {
        padding: 1.5rem 0;
    }

    .hero-content h1 {
        font-size: 1.75rem;
        line-height: 1.2;
        margin-bottom: 0.75rem;
    }

    .hero-content p {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }

    .hero-cta {
        flex-direction: column;
        align-items: stretch;
    }

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

    .hero-stats {
        flex-direction: column;
        gap: 20px;
    }

    /* Page headers - more compact */
    .page-header {
        padding: 1.25rem 0;
    }

    .page-header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .breadcrumb {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }

    /* Cart page optimizations - more compact */
    .cart-section {
        padding: 1.5rem 0;
    }

    .cart-item {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.875rem;
        margin-bottom: 0.75rem;
    }

    .item-details h3 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }

    .item-details p {
        font-size: 0.85rem;
        margin-bottom: 0.25rem;
    }

    .item-actions {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .item-price {
        font-size: 1.15rem;
    }

    .url-input-group {
        flex-direction: column;
        gap: 6px;
        margin-top: 0.5rem;
    }

    .url-input-group .btn {
        width: 100%;
    }

    /* Cart summary - more compact */
    .cart-summary,
    .order-summary {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .cart-summary h2,
    .order-summary h2 {
        font-size: 1.15rem;
        margin-bottom: 0.75rem;
    }

    .summary-row {
        padding: 0.5rem 0;
        font-size: 0.9rem;
    }

    .summary-row.total {
        font-size: 1.05rem;
        padding-top: 0.75rem;
    }

    /* Checkout page optimizations - more compact */
    .checkout-section {
        padding: 1.5rem 0;
    }

    .checkout-form {
        padding: 1rem;
    }

    .checkout-section-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .section-header {
        margin-bottom: 0.75rem;
    }

    .section-header h2 {
        font-size: 1.05rem;
    }

    .section-number {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }

    .form-section {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }

    /* Payment method selector */
    .payment-method-selector {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .payment-method-card {
        padding: 12px;
    }

    .payment-icon {
        font-size: 1.5rem;
    }

    .payment-method-info h4 {
        font-size: 0.95rem;
    }

    .accepted-cards i {
        font-size: 1.25rem;
    }

    /* Security badges - more compact */
    .security-badges {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        font-size: 0.75rem;
        padding: 0.75rem 0;
        margin-bottom: 1rem;
    }

    .security-badge {
        padding: 0.5rem;
    }

    .security-badge i {
        font-size: 1.1rem;
    }

    .security-badge-title {
        font-size: 0.75rem;
    }

    .security-badge-subtitle {
        font-size: 0.7rem;
    }

    /* Order bump */
    .order-bump {
        padding: 15px;
    }

    .order-bump-header {
        font-size: 0.85rem;
        padding: 8px 12px;
    }

    .order-bump-details h4 {
        font-size: 0.95rem;
    }

    .order-bump-pricing {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Summary items - more compact */
    .summary-items {
        padding: 0.75rem;
        max-height: 300px;
    }

    .summary-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }

    .item-details {
        width: 100%;
    }

    .item-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .item-title {
        font-size: 0.9rem;
        line-height: 1.2;
    }

    .item-meta {
        flex-wrap: wrap;
        font-size: 0.75rem;
        gap: 0.5rem;
    }

    .item-delivery {
        font-size: 0.75rem;
    }

    .item-price-box {
        align-self: flex-end;
        font-size: 1rem;
    }

    /* Form inputs - compact */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 10px 12px;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .form-hint {
        font-size: 0.8rem;
        margin-top: 0.25rem;
    }

    /* Buttons - compact */
    .btn {
        padding: 0.65rem 1.15rem;
        font-size: 0.9rem;
    }

    .btn-lg {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }

    .btn-sm {
        padding: 0.45rem 0.75rem;
        font-size: 0.8rem;
    }

    .btn-block {
        width: 100%;
    }

    /* Product cards */
    .product-card {
        padding: 1.25rem;
    }

    .product-card h3 {
        font-size: 1.05rem;
    }

    /* Product details page - more compact */
    .product-details {
        padding: 1.5rem 0;
    }

    .product-hero {
        padding: 1rem 0;
    }

    .product-hero-content h1 {
        font-size: 1.35rem;
        margin-bottom: 0.5rem;
    }

    .product-tagline {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }

    .product-trust-badges {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .trust-badge {
        font-size: 0.75rem;
        padding: 0.35rem 0.6rem;
    }

    .product-value,
    .product-benefits,
    .product-features {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .product-value h2 {
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
    }

    .value-description {
        font-size: 0.9rem;
    }

    /* Packages - more compact */
    .packages-section {
        padding: 1rem;
    }

    .packages-header h2 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }

    .packages-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .package-card {
        padding: 1rem;
    }

    .package-card h3 {
        font-size: 1rem;
    }

    /* Benefits grid - more compact */
    .benefits-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .benefit-item {
        padding: 0.75rem;
    }

    .benefit-item i {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .benefit-item h4 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .benefit-item p {
        font-size: 0.85rem;
    }

    /* Grids - more compact */
    .categories-grid,
    .platforms-grid,
    .products-grid,
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Feature cards - more compact */
    .feature-card {
        padding: 1.25rem;
    }

    .feature-card i {
        font-size: 2.25rem;
        margin-bottom: 0.75rem;
    }

    .feature-card h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .feature-card p {
        font-size: 0.9rem;
    }

    /* Category cards - more compact */
    .category-card {
        padding: 1.25rem;
    }

    .category-icon {
        width: 55px;
        height: 55px;
        margin-bottom: 1rem;
    }

    .category-icon i {
        font-size: 1.5rem;
    }

    .category-card h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .category-card p {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }

    /* ========================================
       OTHER PAGES - COMPACT
       ======================================== */

    /* About page */
    .about-hero,
    .about-content,
    .about-team,
    .about-values {
        padding: 1.5rem 0 !important;
    }

    .about-hero h1 {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
    }

    .about-content p {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }

    .team-grid {
        gap: 1rem;
    }

    .team-member {
        padding: 1rem;
    }

    .team-photo {
        width: 80px;
        height: 80px;
        margin-bottom: 0.75rem;
    }

    /* Contact page */
    .contact-section {
        padding: 1.5rem 0;
    }

    .contact-form {
        padding: 1rem;
    }

    .contact-info {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .contact-info-item {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .contact-info-item i {
        font-size: 1.25rem;
    }

    .contact-info-item h3 {
        font-size: 1rem;
    }

    .contact-info-item p {
        font-size: 0.85rem;
    }

    /* FAQ page */
    .faq-section {
        padding: 1.5rem 0;
    }

    .faq-item {
        margin-bottom: 0.75rem;
    }

    .faq-question {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }

    .faq-answer {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    /* Search page */
    .search-section {
        padding: 1.5rem 0;
    }

    .search-results-header {
        padding: 1rem 0;
        margin-bottom: 1rem;
    }

    .search-results-header h2 {
        font-size: 1.3rem;
    }

    .search-results-count {
        font-size: 0.85rem;
    }

    /* Login/Register pages */
    .auth-section {
        padding: 1.5rem 0;
    }

    .auth-container {
        max-width: 100%;
        padding: 1rem;
        margin: 0;
    }

    .auth-header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .auth-header p {
        font-size: 0.85rem;
    }

    .auth-form {
        padding: 1rem;
    }

    .auth-divider {
        margin: 1rem 0;
    }

    .social-login-buttons {
        gap: 0.75rem;
    }

    .social-btn {
        padding: 0.65rem;
        font-size: 0.9rem;
    }

    /* Dashboard page */
    .dashboard-section {
        padding: 1.5rem 0;
    }

    .dashboard-header {
        padding: 1rem 0;
        margin-bottom: 1rem;
    }

    .dashboard-header h1 {
        font-size: 1.5rem;
    }

    .dashboard-stats {
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .dashboard-stat-card {
        padding: 0.875rem;
    }

    .dashboard-stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .dashboard-stat-value {
        font-size: 1.25rem;
    }

    .dashboard-stat-label {
        font-size: 0.75rem;
    }

    .dashboard-recent-orders {
        padding: 1rem;
    }

    .dashboard-recent-orders h3 {
        font-size: 1.15rem;
        margin-bottom: 1rem;
    }

    /* Orders page */
    .orders-section {
        padding: 1.5rem 0;
    }

    .orders-header {
        padding: 1rem 0;
        margin-bottom: 1rem;
    }

    .order-card {
        padding: 0.875rem;
        margin-bottom: 0.75rem;
    }

    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }

    .order-id {
        font-size: 0.9rem;
    }

    .order-date {
        font-size: 0.75rem;
    }

    .order-status {
        font-size: 0.8rem;
        padding: 0.35rem 0.6rem;
    }

    .order-items {
        margin-bottom: 0.75rem;
    }

    .order-item {
        padding: 0.5rem 0;
        font-size: 0.85rem;
    }

    .order-total {
        padding-top: 0.75rem;
        font-size: 0.95rem;
    }

    /* Platform page */
    .platform-header {
        padding: 1.5rem 0;
    }

    .platform-header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .platform-description {
        font-size: 0.9rem;
    }

    .platform-products {
        padding: 1.5rem 0;
    }

    /* Category page */
    .category-header {
        padding: 1.5rem 0;
    }

    .category-header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .category-description {
        font-size: 0.9rem;
    }

    .category-platforms {
        padding: 1.5rem 0;
    }

    /* Terms, Privacy pages */
    .legal-section {
        padding: 1.5rem 0;
    }

    .legal-content {
        padding: 1rem;
    }

    .legal-content h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .legal-content h2 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
        margin-top: 1.25rem;
    }

    .legal-content h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
        margin-top: 1rem;
    }

    .legal-content p {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }

    .legal-content ul,
    .legal-content ol {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
        padding-left: 1.5rem;
    }

    .legal-content li {
        margin-bottom: 0.5rem;
    }

    /* Footer - more compact */
    .footer {
        padding: 1.5rem 0;
    }

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

    .footer-section h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .footer-section ul li {
        margin-bottom: 0.5rem;
    }

    .footer-section a {
        font-size: 0.9rem;
    }

    .footer-bottom {
        padding: 1rem 0;
        font-size: 0.85rem;
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    /* Dashboard */
    .dashboard-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .dashboard-sidebar {
        position: static;
    }

    /* Tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 0.85rem;
    }

    /* Modal improvements */
    .modal-content {
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ============================================
   Small Mobile Devices (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {
    /* Even smaller container padding */
    .container {
        padding: 0 10px;
    }

    /* Typography */
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    /* Logo */
    .logo a span {
        font-size: 1rem;
    }

    .logo i {
        font-size: 1.25rem;
    }

    /* Hero */
    .hero {
        padding: 2rem 0;
    }

    .hero-content h1 {
        font-size: 1.75rem;
    }

    .hero-content p {
        font-size: 0.95rem;
    }

    /* Page headers */
    .page-header h1 {
        font-size: 1.5rem;
    }

    /* Cart and checkout */
    .cart-summary,
    .order-summary {
        padding: 1rem;
    }

    .checkout-form {
        padding: 1rem;
    }

    .checkout-section-card {
        padding: 1rem;
    }

    /* Security badges - stack vertically */
    .security-badges {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* Buttons */
    .btn {
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
    }

    .btn-lg {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }

    /* Cards */
    .cart-item,
    .product-card,
    .feature-card,
    .category-card {
        padding: 1rem;
    }

    /* Price displays */
    .item-price {
        font-size: 1.15rem;
    }

    .price {
        font-size: 1.25rem;
    }

    /* Order summary totals */
    .summary-row {
        font-size: 0.95rem;
    }

    .summary-row.total {
        font-size: 1.1rem;
    }

    /* Progress steps */
    .progress-steps {
        scale: 0.9;
    }

    .step-circle {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .step-label {
        font-size: 11px;
    }

    .progress-line {
        width: 30px;
    }

    /* Header actions - make icons smaller */
    .btn-icon,
    .btn-cart {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .cart-badge {
        width: 18px;
        height: 18px;
        font-size: 0.7rem;
    }
}

/* ============================================
   Very Small Devices (max-width: 360px)
   ============================================ */
@media (max-width: 360px) {
    /* Ultra compact mode */
    .container {
        padding: 0 8px;
    }

    h1 {
        font-size: 1.35rem;
    }

    h2 {
        font-size: 1.15rem;
    }

    .hero-content h1 {
        font-size: 1.5rem;
    }

    .btn {
        padding: 0.6rem 0.85rem;
        font-size: 0.85rem;
    }

    .btn-lg {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }
}

/* ============================================
   Landscape Mode Optimizations
   ============================================ */
@media (max-height: 600px) and (orientation: landscape) {
    /* Reduce vertical padding in landscape */
    .hero {
        padding: 1.5rem 0;
    }

    .page-header {
        padding: 1.5rem 0;
    }

    section {
        padding: 2rem 0;
    }

    /* Make modals scrollable */
    .modal-content {
        max-height: 80vh;
        overflow-y: auto;
    }
}

/* ============================================
   Touch-friendly Improvements
   ============================================ */

/* Larger touch targets for interactive elements */
@media (max-width: 768px) {
    /* Links in lists */
    .dropdown-menu a,
    .nav-link,
    .footer-links a {
        padding: 12px 16px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Form checkboxes and radios */
    input[type="checkbox"],
    input[type="radio"] {
        min-width: 20px;
        min-height: 20px;
    }

    /* Payment method options */
    .payment-method-option {
        min-height: 60px;
    }

    /* Remove hover effects on touch devices */
    @media (hover: none) {
        .btn:hover,
        .product-card:hover,
        .category-card:hover {
            transform: none;
        }
    }
}

/* ============================================
   Loading and Performance
   ============================================ */

/* Prevent layout shift during image load */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Lazy loading support */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* ============================================
   Accessibility Improvements
   ============================================ */
@media (max-width: 768px) {
    /* Better focus states for keyboard navigation */
    button:focus,
    a:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 3px solid var(--primary-color);
        outline-offset: 2px;
    }

    /* Skip to content link for screen readers */
    .skip-to-content {
        position: absolute;
        top: -40px;
        left: 0;
        background: var(--primary-color);
        color: white;
        padding: 8px;
        text-decoration: none;
        z-index: 100;
    }

    .skip-to-content:focus {
        top: 0;
    }
}

/* ============================================
   Print Optimization
   ============================================ */
@media print {
    .header,
    .footer,
    .header-actions,
    .mobile-menu-toggle,
    .btn,
    .chat-widget {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }
}
