/* Responsive Design for Survive The Game */

/* Base Fix for Navbar Overlap - Added this new section */
:root {
    --navbar-height-mobile: 70px;
}

body {
    scroll-padding-top: var(--navbar-height-mobile);
}

/* Mobile First Approach */
@media (max-width: 768px) {
    /* Navigation - Updated with fixed positioning */
    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: var(--navbar-height-mobile);
        padding: 0.5rem 0;
        z-index: 1000;
        background: var(--background-primary);
        box-shadow: 0 2px 10px var(--shadow-color);
    }
    
    .nav-container {
        padding: 0.75rem 1rem;
        height: 100%;
    }

    /* Added padding to all main content sections */
    .shop-header,
    .product-details,
    .cart-section,
    .receipt-section,
    .about-hero,
    .contact-hero,
    .featured-products,
    .brand-story,
    .related-products,
    .about-story,
    .values-section,
    .mission-section,
    .contact-info,
    .social-section {
        padding-top: calc(var(--navbar-height-mobile) + 20px) !important;
    }

    /* Rest of your existing mobile styles... */
    .nav-menu {
        position: fixed;
        top: var(--navbar-height-mobile);
        left: 0;
        width: 100%;
        background: var(--background-primary);
        border-top: 1px solid var(--border-color);
        padding: 1.25rem 1rem;
        flex-direction: column;
        gap: 0.8rem;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-18px);
        transition: var(--transition-smooth);
        z-index: 999;
        box-shadow: 0 4px 18px var(--shadow-color);
    }

    .nav-menu.active {
        top: var(--navbar-height-mobile);
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .nav-actions {
        gap: 0.5rem;
    }

    .currency-toggle button {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    /* Hero Section */
    .hero-content {
        padding: calc(var(--navbar-height-mobile) + 2rem) 1rem 2rem;
    }

    .hero-title {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }

    .hero-slogan {
        font-size: clamp(1rem, 4vw, 1.5rem);
        margin-bottom: 2rem;
    }

    .cta-button {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }

    /* Products Grid */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .product-card {
        border-radius: 12px;
    }

    .product-image {
        height: 200px;
    }

    .product-info {
        padding: 1rem;
    }

    .product-name {
        font-size: 1rem;
    }

    .product-price {
        font-size: 1rem;
    }

    .add-to-cart {
        padding: 0.625rem;
        font-size: 0.9rem;
    }

    /* Sections */
    .section-title {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
        margin-bottom: 2rem;
    }

    .featured-products,
    .brand-story {
        padding: 3rem 0;
    }

    .story-content p {
        font-size: 1rem;
    }

    /* Shop Header - Adjusted */
    .shop-header {
        padding: calc(var(--navbar-height-mobile) + 20px) 0 25px;
    }

    .shop-header h1 {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .shop-header p {
        font-size: 1rem;
    }

    .filter-row {
        flex-direction: column;
        gap: 1rem;
    }

    .search-box {
        min-width: auto;
    }

    .filter-controls {
        width: 100%;
        justify-content: space-between;
    }

    .filter-controls select {
        flex: 1;
        max-width: calc(50% - 0.5rem);
    }

    /* Product Detail Page - Adjusted */
    .product-details {
        padding: calc(var(--navbar-height-mobile) + 20px) 0 30px;
    }

    .product-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .product-images {
        position: static;
        margin: 0;
        padding: 0;
    }

    .main-image {
        margin-bottom: 5px;
    }

    .main-image img {
        height: 450px;
        width: 100%;
        object-fit: cover;
        object-position: top center;
        display: block;
        margin: 0;
    }

    /* Thumbnail Grid - Adjusted */
    .thumbnail-images {
        display: flex;
        flex-wrap: wrap;
        gap: 0;
        overflow-x: hidden;
        padding-bottom: 0.5rem;
    }

    .thumbnail {
        width: 70px;
        height: 70px;
        margin: 0 2px 2px 0;
        border-radius: 8px;
        object-fit: cover;
        cursor: pointer;
        border: 2px solid transparent;
        transition: var(--transition-fast);
    }

    .product-info h1 {
        font-size: 2rem;
    }

    .product-price {
        font-size: 1.5rem;
    }

    .product-description {
        font-size: 1rem;
    }

    .product-actions {
        flex-direction: column;
    }

    .add-to-cart-btn,
    .buy-now-btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    .related-products {
        padding: 3rem 0;
    }

    .related-products h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    /* Cart Page - Adjusted */
    .cart-section {
        padding: calc(var(--navbar-height-mobile) + 20px) 0 30px;
    }

    .cart-section h1 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .cart-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .cart-item {
        grid-template-columns: 80px 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .cart-item-image {
        width: 80px;
        height: 80px;
    }

    .cart-item-info {
        grid-column: 1 / -1;
        margin-top: 1rem;
    }

    .cart-item-price {
        grid-column: 1;
        margin-top: 0.5rem;
    }

    .quantity-controls-cart {
        grid-column: 1;
        margin-top: 0.5rem;
    }

    .remove-item {
        grid-column: 2;
        justify-self: end;
        align-self: start;
    }

    .cart-summary {
        position: static;
        margin-top: 1rem;
    }

    /* Cart Link - Adjusted */
    .cart-link {
        padding: 0.3rem;
    }

    .cart-count {
        top: -3px;
        right: -3px;
        width: 18px;
        height: 18px;
        font-size: 0.7rem;
    }

    /* Modal */
    .modal-content {
        margin: 10% auto;
        padding: 1.5rem;
        width: 95%;
    }

    /* Receipt Page */
    .receipt-section {
        padding: calc(var(--navbar-height-mobile) + 20px) 0 30px;
    }

    .receipt-container {
        padding: 2rem 1rem;
        margin: 0 1rem;
    }

    .receipt-header h1 {
        font-size: 1.5rem;
    }

    .receipt-logo {
        width: 60px;
        height: 60px;
    }

    .receipt-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* About Page */
    .about-hero {
        padding: calc(var(--navbar-height-mobile) + 20px) 0 40px;
    }

    .about-hero h1 {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .about-story {
        padding: 3rem 0;
    }

    .story-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .story-text h2 {
        font-size: 2rem;
    }

    .story-text p {
        font-size: 1rem;
    }

    .story-image img {
        height: 300px;
    }

    .values-section {
        padding: 3rem 0;
    }

    .values-section h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .values-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .value-card {
        padding: 1.5rem;
    }

    .mission-section {
        padding: 3rem 0;
    }

    .mission-content h2 {
        font-size: 2rem;
    }

    .mission-content p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .mission-stats {
        gap: 2rem;
    }

    .stat h3 {
        font-size: 2rem;
    }

    /* Contact Page */
    .contact-hero {
        padding: calc(var(--navbar-height-mobile) + 20px) 0 30px;
    }

    .contact-hero h1 {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .contact-info {
        padding: 3rem 0;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .contact-card {
        padding: 1.5rem;
    }

    .social-section {
        padding: 3rem 0;
    }

    .social-section h2 {
        font-size: 2rem;
    }

    .social-section p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .social-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .social-card {
        padding: 1rem;
    }

    /* Footer */
    .footer {
        padding: 3rem 0 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-section h3 {
        font-size: 1.125rem;
    }

    .social-links {
        gap: 0.5rem;
    }

    .social-links a {
        padding: 0.375rem;
        font-size: 0.9rem;
    }

    /* Cookie Banner */
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .cookie-content p {
        font-size: 0.9rem;
    }

    .btn-accept {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }

    /* Utility Classes for Mobile */
    .mobile-hidden {
        display: none !important;
    }

    .mobile-block {
        display: block !important;
    }

    .mobile-flex {
        display: flex !important;
    }

    .mobile-grid {
        display: grid !important;
    }
}

/* Tablet Styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 0 2rem;
    }

    .nav-container {
        padding: 1rem 2rem;
    }

    .hero-content {
        padding: 0 2rem;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .product-layout {
        gap: 3rem;
    }

    .cart-content {
        gap: 2.5rem;
    }

    .story-grid {
        gap: 3rem;
    }

    .values-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .social-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large Screens */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }

    .hero-title {
        font-size: 7rem;
    }

    .hero-slogan {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 4rem;
    }

    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .product-image {
        height: 350px;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .no-print {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .receipt-container {
        box-shadow: none !important;
        margin: 0 !important;
        border: 1px solid #ccc;
    }

    .receipt-header {
        border-bottom: 2px solid #000;
    }

    .receipt-logo {
        filter: grayscale(100%);
    }

    .status-paid {
        color: #000 !important;
    }

    .final-total {
        border-top: 2px solid #000;
        font-weight: bold;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo,
    .receipt-logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }

    .hero-slide {
        transition: opacity 0.5s ease-in-out;
    }
}

/* Dark Mode Media Query */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --primary-color: var(--dark-primary-color);
        --secondary-color: var(--dark-secondary-color);
        --text-primary: var(--dark-text-primary);
        --text-secondary: var(--dark-text-secondary);
        --text-light: var(--dark-text-light);
        --background-primary: var(--dark-background-primary);
        --background-secondary: var(--dark-background-secondary);
        --border-color: var(--dark-border-color);
        --shadow-color: var(--dark-shadow-color);
    }
}

/* Focus Styles for Accessibility */
@media (min-width: 769px) {
    *:focus {
        outline: 2px solid var(--accent-color);
        outline-offset: 2px;
    }

    button:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 2px solid var(--accent-color);
        outline-offset: 2px;
    }
}

/* Hover States for Touch Devices */
@media (hover: none) and (pointer: coarse) {
    .product-card:hover {
        transform: none;
        box-shadow: 0 4px 20px var(--shadow-color);
    }

    .social-card:hover {
        transform: none;
        box-shadow: 0 2px 10px var(--shadow-color);
    }

    .value-card:hover {
        transform: none;
        box-shadow: 0 4px 20px var(--shadow-color);
    }

    .contact-card:hover {
        transform: none;
        box-shadow: 0 4px 20px var(--shadow-color);
    }

    .cta-button:hover {
        transform: none;
        box-shadow: 0 10px 30px rgba(255, 0, 0, 0.3);
    }
}


/* Responsive styles for price display */
@media (max-width: 768px) {
    /* Price container for mobile */
    .price-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .product-price {
        font-size: 1rem;
        line-height: 1.2;
    }

    .product-previous-price {
        font-size: 0.875rem;
        line-height: 1.2;
    }

    /* Adjust spacing for product info */
    .product-info {
        padding: 0.75rem;
    }
}

/* Tablet styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .price-container {
        gap: 0.5rem;
    }

    .product-price {
        font-size: 1.125rem;
    }

    .product-previous-price {
        font-size: 0.9375rem;
    }
}

/* Adjustments for very small mobile screens */
@media (max-width: 480px) {
    .price-container {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .product-price {
        font-size: 0.9375rem;
    }

    .product-previous-price {
        font-size: 0.8125rem;
    }
}

/* Special case for when price and previous price don't fit in one line */
@media (max-width: 350px) {
    .price-container {
        flex-direction: column;
        gap: 0.1rem;
    }
}

@media (max-width: 768px) {
    .promo-text {
        font-size: 0.9rem;
        padding: 0 15px;
    }
    
    .promo-close {
        font-size: 1.3rem;
        padding: 0 5px;
    }
}