/* ========================================
   COMPREHENSIVE MOBILE FIXES
   For Samsung Browser, Equipment Cards, and Contact Page

   Add this file to your project and include it LAST
   in your HTML files after all other CSS:

   <link rel="stylesheet" href="{{ url_for('static', filename='css/mobile-fixes.css') }}">
   ======================================== */

/* ========================================
   SAMSUNG/ANDROID BROWSER - FIXED BUTTONS
   Samsung Browser has a large bottom toolbar
   that covers elements with low bottom values
   ======================================== */

/* Filter Toggle Button */
@media screen and (max-width: 768px) {
    .mobile-filter-toggle {
        position: fixed !important;
        bottom: 100px !important; /* Much higher for Samsung */
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 9998 !important;
        display: flex !important;
    }
}

/* Basket Button */
@media screen and (max-width: 768px) {
    .basket-button {
        position: fixed !important;
        top: auto !important;
        bottom: 100px !important; /* Much higher for Samsung */
        right: 20px !important;
        z-index: 9999 !important;
    }
}

/* Add bottom padding to pages so content isn't hidden */
@media screen and (max-width: 768px) {
    .equipment-container,
    .gallery-container,
    .content {
        padding-bottom: 150px !important;
    }
}

/* ========================================
   EQUIPMENT CARDS - BIGGER WITH FULL IMAGES
   ======================================== */

/* Make cards bigger and show full images */
.equipment-card {
    min-height: auto;
}

.equipment-card-image {
    height: 280px; /* Increased from 220px */
    min-height: 280px;
    overflow: hidden;
    background: var(--light-gray, #f5f5f5);
}

.equipment-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This ensures image covers the area */
    object-position: center; /* Center the image */
}

/* Placeholder image styling */
.equipment-card-image .placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile - slightly smaller but still good */
@media screen and (max-width: 768px) {
    .equipment-card-image {
        height: 240px;
        min-height: 240px;
    }

    .equipment-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 1.5rem;
    }

    .equipment-card-content {
        padding: 1.25rem;
    }

    .equipment-card-content h3 {
        font-size: 1.1rem;
        line-height: 1.4;
    }
}

/* Tablet - 2 columns */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .equipment-card-image {
        height: 250px;
        min-height: 250px;
    }

    .equipment-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop - larger images */
@media screen and (min-width: 1025px) {
    .equipment-card-image {
        height: 280px;
        min-height: 280px;
    }

    .equipment-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* ========================================
   CONTACT PAGE - MOBILE CARD LAYOUT FIX
   ======================================== */

/* Contact options - stack vertically on mobile */
@media screen and (max-width: 768px) {
    .contact-options-grid {
        grid-template-columns: 1fr !important; /* Single column */
        gap: 1rem !important;
    }

    .contact-option-card {
        flex-direction: row !important; /* Horizontal layout */
        text-align: left !important;
        padding: 1.25rem 1.5rem !important;
        gap: 1rem !important;
        align-items: center !important;
    }

    .contact-option-card .contact-option-icon {
        font-size: 2.5rem !important;
        margin-bottom: 0 !important;
        flex-shrink: 0 !important;
    }

    /* Text container */
    .contact-option-card > div:not(.contact-option-icon),
    .contact-option-card h3,
    .contact-option-card p,
    .contact-option-card .contact-option-detail {
        text-align: left !important;
    }

    .contact-option-card h3 {
        font-size: 1.1rem !important;
        margin-bottom: 0.25rem !important;
    }

    .contact-option-card p {
        font-size: 0.9rem !important;
        margin-bottom: 0.25rem !important;
        display: block !important;
    }

    .contact-option-detail {
        font-size: 0.85rem !important;
        word-break: break-word !important;
        display: block !important;
    }

    /* Make 5th card (browse) same as others */
    .contact-options-grid .contact-option-card:nth-child(5) {
        grid-column: auto !important;
        max-width: none !important;
        margin: 0 !important;
    }

    .contact-options-container {
        padding: 0 1rem !important;
    }

    .contact-options-title {
        font-size: 1.6rem !important;
    }

    .contact-options-subtitle {
        font-size: 1rem !important;
        margin-bottom: 2rem !important;
    }
}

/* Very small screens */
@media screen and (max-width: 380px) {
    .contact-option-card {
        padding: 1rem !important;
    }

    .contact-option-card .contact-option-icon {
        font-size: 2rem !important;
    }

    .contact-option-card h3 {
        font-size: 1rem !important;
    }

    .contact-option-detail {
        font-size: 0.8rem !important;
    }
}

/* ========================================
   EXTRA INFO CARDS - MOBILE FIX
   ======================================== */
@media screen and (max-width: 768px) {
    .info-extra-container {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .info-extra-card {
        padding: 1.25rem !important;
    }

    .info-extra-card h3 {
        font-size: 1rem !important;
    }

    .info-extra-card p {
        font-size: 0.9rem !important;
    }
}

/* ========================================
   ENSURE HAMBURGER MENU IS VISIBLE
   ======================================== */
@media screen and (max-width: 768px) {
    .hamburger-menu {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* ========================================
   SAFE AREA SUPPORT FOR NOTCHED PHONES
   ======================================== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    @media screen and (max-width: 768px) {
        .mobile-filter-toggle {
            bottom: calc(100px + env(safe-area-inset-bottom)) !important;
        }

        .basket-button {
            bottom: calc(100px + env(safe-area-inset-bottom)) !important;
        }

        .equipment-container,
        .gallery-container,
        .content {
            padding-bottom: calc(150px + env(safe-area-inset-bottom)) !important;
        }
    }
}