/* ============================================
   Enhanced Responsive Design
   Mobile-First Approach with Advanced Breakpoints
   ============================================ */

/* ============================================
   Extra Small Devices (Portrait Phones)
   < 576px
   ============================================ */
@media (max-width: 575.98px) {
    /* Hero Section */
    .hero {
        padding: 2rem 1rem;
        min-height: auto;
    }
    
    .hero-badge {
        font-size: 0.8rem !important;
        padding: 0.4rem 1rem !important;
    }
    
    .hero-title {
        font-size: 2rem !important;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1rem !important;
        padding: 0.8rem 1.5rem !important;
    }
    
    .hero-image {
        margin: 1.5rem auto;
    }
    
    .btn-primary {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
    
    /* Section Spacing */
    section {
        padding: 2rem 0.75rem !important;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    /* Section Titles */
    .section-title {
        font-size: 1.5rem !important;
        margin-bottom: 1.5rem;
    }
    
    /* Product Details */
    .product-description {
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }
    
    /* Benefits List */
    .benefits-list {
        gap: 0.8rem;
    }
    
    .benefit-item {
        font-size: 0.95rem;
        padding: 0.8rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .checkmark {
        font-size: 1.5rem;
    }
    
    /* Ingredients List */
    .ingredients-list {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .ingredients-list li {
        font-size: 1rem;
        padding: 0.8rem;
    }
    
    /* Gallery Grid */
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .gallery-grid img {
        height: 250px;
    }
    
    /* Choose Grid */
    .choose-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .choose-item {
        padding: 1.5rem;
    }
    
    .choose-item h3 {
        font-size: 1.2rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Pricing Cards */
    .pricing-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .pricing-card {
        padding: 1.5rem;
    }
    
    .pricing-card.featured {
        transform: scale(1) !important;
        margin: 0;
    }
    
    .pricing-card h3 {
        font-size: 1.4rem;
    }
    
    .pricing-card .new-price,
    .pricing-card .price {
        font-size: 2rem;
    }
    
    .discount-badge {
        font-size: 0.85rem;
        padding: 0.4rem 1rem;
    }
    
    /* Order Form */
    .order-form form {
        padding: 1.5rem;
    }
    
    .order-form h2 {
        font-size: 1.8rem !important;
    }
    
    .order-form input,
    .order-form textarea {
        padding: 1rem;
        font-size: 0.95rem;
    }
    
    .package-list {
        gap: 0.6rem;
    }
    
    .package-option {
        padding: 0.6rem;
    }
    
    .selected-package-summary {
        padding: 0.8rem;
    }
    
    /* Guarantee Items */
    .guarantee-items {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .guarantee-item {
        padding: 1.5rem;
    }
    
    .guarantee-item .icon {
        font-size: 2.5rem !important;
    }
    
    /* Review Cards */
    .review-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .review-card {
        padding: 1.5rem;
    }
    
    .review-card .stars {
        font-size: 1.5rem;
    }
    
    /* Footer */
    footer {
        padding: 2rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Sticky CTA */
    .sticky-cta {
        bottom: 20px !important;
        top: auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: calc(100% - 2rem);
        max-width: 300px;
        text-align: center;
        padding: 1rem;
        font-size: 1rem;
    }
    
    .sticky-cta:hover {
        transform: translateX(-50%) translateY(-4px) !important;
    }
    
    /* Video Section */
    .video-section {
        margin: 1.5rem 0;
        padding: 1.5rem 0;
    }
    
    .video-section .section-title {
        font-size: 1.3rem;
    }
}

/* ============================================
   Small Devices (Landscape Phones)
   576px - 767.98px
   ============================================ */
@media (min-width: 576px) and (max-width: 767.98px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .pricing-cards {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-grid img {
        height: 220px;
    }
    
    .ingredients-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .guarantee-items {
        grid-template-columns: 1fr;
    }
    
    .review-cards {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Medium Devices (Tablets)
   768px - 991.98px
   ============================================ */
@media (min-width: 768px) and (max-width: 991.98px) {
    .hero {
        padding: 3rem 1.5rem;
    }
    
    .hero-title {
        font-size: 2.8rem;
    }
    
    .pricing-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-grid img {
        height: 280px;
    }
    
    .choose-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .guarantee-items {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .review-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ingredients-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   Large Devices (Desktops)
   992px - 1199.98px
   ============================================ */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }
    
    .pricing-cards {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   Extra Large Devices (Large Desktops)
   >= 1200px
   ============================================ */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    /* Enhanced hover effects for desktop */
    .pricing-card:hover {
        transform: translateY(-16px) scale(1.03);
    }
    
    .review-card:hover {
        transform: translateY(-16px) rotateX(3deg);
    }
    
    .choose-item:hover {
        transform: translateY(-16px) scale(1.05);
    }
}

/* ============================================
   Landscape Orientation Optimizations
   ============================================ */
@media (orientation: landscape) and (max-height: 600px) {
    .hero {
        min-height: auto;
        padding: 2rem 1rem;
    }
    
    .hero-image {
        max-width: 400px;
    }
    
    section {
        padding: 2rem 1rem;
    }
}

/* ============================================
   Touch Device Optimizations
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .pricing-card:hover,
    .review-card:hover,
    .guarantee-item:hover,
    .choose-item:hover {
        transform: none;
    }
    
    /* Make buttons larger for touch */
    .btn-primary,
    .btn-submit,
    .select-package {
        min-height: 48px;
        padding: 1rem 2rem;
    }
    
    /* Increase tap targets */
    .package-radio {
        width: 24px !important;
        height: 24px !important;
    }
    
    /* Remove card tilt effects */
    .pricing-card,
    .review-card,
    .choose-item {
        transform: none !important;
    }
}

/* ============================================
   High DPI Screens (Retina)
   ============================================ */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    /* Optimize images for retina */
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
    
    /* Enhance text rendering */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ============================================
   Dark Mode Preferences
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Optional: Add dark mode styles if needed */
    /* Currently not implemented to maintain brand consistency */
}

/* ============================================
   Reduced Motion Preferences
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .hero::before,
    .hero::after {
        animation: none !important;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    /* Hide non-essential elements */
    .sticky-cta,
    .btn-primary,
    .btn-submit,
    .hero::before,
    .hero::after {
        display: none !important;
    }
    
    /* Optimize for print */
    body {
        background: white;
        color: black;
    }
    
    section {
        page-break-inside: avoid;
    }
    
    .pricing-card,
    .review-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    /* Expand all content */
    .container {
        max-width: 100%;
    }
}

/* ============================================
   Container Queries (Future-proofing)
   ============================================ */
@container (max-width: 600px) {
    .pricing-card {
        padding: 1rem;
    }
}

/* ============================================
   Utility Classes for Responsive Control
   ============================================ */
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

@media (max-width: 767.98px) {
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
    
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .hide-desktop {
        display: none !important;
    }
}

/* ============================================
   Flexible Typography
   ============================================ */
@media (max-width: 575.98px) {
    html {
        font-size: 14px;
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    html {
        font-size: 15px;
    }
}

@media (min-width: 992px) {
    html {
        font-size: 16px;
    }
}

/* ============================================
   Grid System Enhancements
   ============================================ */
.responsive-grid {
    display: grid;
    gap: 1rem;
}

@media (max-width: 575.98px) {
    .responsive-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .responsive-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .responsive-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}
