/* Mobil Modal Optimizasyonları - Ekipmanlar Sayfası */

/* 768px ve altı için mobil optimizasyonları */
@media (max-width: 768px) {
    /* Modal overlay mobile optimizasyonu */
    .product-modal {
        z-index: 9999;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        overflow-y: auto;
        padding: 10px;
        box-sizing: border-box;
    }
    
    .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(3px);
    }
    
    /* Modal content mobil optimizasyonu */
    .modal-content {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        width: calc(100vw - 20px);
        max-width: none;
        min-height: auto;
        max-height: min(70vh, calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 100px));
        margin: 10px auto;
        border-radius: 12px;
        display: flex;
        flex-direction: column;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        /* iOS Safari scroll fix */
        -webkit-overflow-scrolling: touch;
    }
    
    /* Modal header mobil */
    .modal-header {
        padding: 16px 16px 0;
        margin-bottom: 16px;
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        border-radius: 12px 12px 0 0;
        flex-shrink: 0;
    }
    
    .modal-header h3 {
        font-size: 1.3rem;
        line-height: 1.3;
    }
    
    .modal-close {
        padding: 6px;
        font-size: 1.3rem;
        min-width: 40px;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Modal body mobil */
    .modal-body {
        padding: 0 16px 16px;
        overflow-y: auto;
        flex: 1;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Product info mobil layout */
    .modal-product-info {
        flex-direction: column;
        gap: 16px;
        margin-bottom: 20px;
        text-align: center;
    }
    
    .modal-product-image {
        width: 140px;
        height: 140px;
        margin: 0 auto;
        border-radius: 10px;
    }
    
    .modal-product-details {
        text-align: center;
    }
    
    .modal-description {
        font-size: 0.9rem;
        line-height: 1.4;
        margin: 0 0 12px 0;
        text-align: left;
    }
    
    .modal-price {
        font-size: 1.4rem;
        font-weight: 700;
    }
    
    /* Rental options mobil */
    .rental-options {
        padding: 16px;
        border-radius: 10px;
        margin-bottom: 16px;
    }
    
    .options-container {
        flex-direction: column;
        gap: 16px;
        margin-bottom: 16px;
    }
    
    .option-group {
        margin-bottom: 0;
    }
    
    .option-group label {
        font-size: 0.9rem;
        margin-bottom: 8px;
        text-align: left;
    }
    
    /* Quantity ve duration controls mobil */
    .quantity-controls,
    .duration-controls {
        justify-content: center;
        gap: 12px;
    }
    
    .quantity-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        border-radius: 6px;
    }
    
    #rentalQuantity,
    #rentalDuration {
        width: 80px;
        height: 40px;
        font-size: 1rem;
        border-radius: 6px;
    }
    
    /* Total calculation mobil */
    .total-calculation {
        margin-top: 16px;
        padding-top: 16px;
    }
    
    .calculation-row {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .calculation-row.total {
        font-size: 1.1rem;
        margin-top: 10px;
        padding-top: 10px;
    }
    
    /* Modal footer mobil */
    .modal-footer {
        padding: 16px;
        border-top: 1px solid #e5e7eb;
        flex-direction: column;
        gap: 10px;
        position: sticky;
        bottom: 0;
        background: white;
        border-radius: 0 0 12px 12px;
        flex-shrink: 0;
    }
    
    .modal-btn {
        width: 100%;
        padding: 14px 16px;
        font-size: 1rem;
        border-radius: 8px;
        min-height: 48px;
    }
}

/* 480px ve altı için extra küçük ekranlar */
@media (max-width: 480px) {
    .modal-content {
        width: calc(100vw - 10px);
        margin: 5px auto;
        max-height: calc(85vh - 10px);
        border-radius: 10px;
    }
    
    .modal-header {
        padding: 14px 14px 0;
        margin-bottom: 14px;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 0 14px 14px;
    }
    
    .modal-product-image {
        width: 120px;
        height: 120px;
    }
    
    .modal-price {
        font-size: 1.3rem;
    }
    
    .rental-options {
        padding: 14px;
    }
    
    .quantity-controls,
    .duration-controls {
        gap: 10px;
    }
    
    .quantity-btn {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    
    #rentalQuantity,
    #rentalDuration {
        width: 70px;
        height: 36px;
        font-size: 0.95rem;
    }
    
    .modal-footer {
        padding: 14px;
        gap: 8px;
    }
    
    .modal-btn {
        padding: 12px 14px;
        font-size: 0.95rem;
        min-height: 44px;
    }
}

/* 360px ve altı için çok küçük ekranlar */
@media (max-width: 360px) {
    .product-modal {
        padding: 5px;
    }
    
    .modal-content {
        width: calc(85vw - 10px);
        margin: 5px auto;
        border-radius: 8px;
    }
    
    .modal-header {
        padding: 12px 12px 0;
        margin-bottom: 12px;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .modal-close {
        padding: 4px;
        font-size: 1.2rem;
        min-width: 36px;
        min-height: 36px;
    }
    
    .modal-body {
        padding: 0 12px 12px;
    }
    
    .modal-product-image {
        width: 100px;
        height: 100px;
    }
    
    .modal-description {
        font-size: 0.85rem;
    }
    
    .modal-price {
        font-size: 1.2rem;
    }
    
    .rental-options {
        padding: 12px;
    }
    
    .modal-footer {
        padding: 12px;
    }
    
    .modal-btn {
        padding: 10px 12px;
        font-size: 0.9rem;
        min-height: 40px;
    }
}

/* Touch device optimizasyonları */
@media (hover: none) and (pointer: coarse) {
    .quantity-btn:hover {
        border-color: #e5e7eb;
        color: #374151;
        background: white;
    }
    
    .quantity-btn:active {
        border-color: #2563eb;
        color: #2563eb;
        background: #f0f7ff;
        transform: scale(0.95);
    }
    
    .modal-close:hover {
        background: #f3f4f6;
        color: #374151;
    }
    
    .modal-close:active {
        background: #e5e7eb;
    }
    
    .modal-btn.secondary:hover {
        background: #f3f4f6;
    }
    
    .modal-btn.secondary:active {
        background: #e5e7eb;
    }
    
    .modal-btn.primary:hover {
        transform: none;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    }
    
    .modal-btn.primary:active {
        transform: translateY(1px);
        box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
    }
}

/* Landscape orientation mobil optimizasyonu */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-content {
        max-height: calc(85vh - 20px);
        overflow-y: auto;
    }
    
    .modal-product-info {
        flex-direction: row;
        text-align: left;
        gap: 16px;
    }
    
    .modal-product-image {
        width: 100px;
        height: 100px;
        margin: 0;
    }
    
    .modal-product-details {
        text-align: left;
        flex: 1;
    }
    
    .options-container {
        flex-direction: row;
        gap: 16px;
    }
    
    .modal-footer {
        flex-direction: row;
        gap: 12px;
    }
    
    .modal-btn {
        width: auto;
        flex: 1;
    }
}
