.delivery-page {
    padding: 60px 0;
    background: #fff;
    /* iOS Safari */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* Safe area для iPhone с Dynamic Island */
    padding-top: calc(60px + env(safe-area-inset-top));
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
}

/* iPhone 14 Pro Max  */
@media screen and (device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) {
  .delivery-page {
    padding-top: calc(40px + env(safe-area-inset-top));
    overflow-x: hidden;
  }
  
  .delivery-container {
    padding: 0 15px;
  }
  
  .map-container {
    height: 300px;
    border-radius: 16px;
  }
  
  .vehicles-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .vehicle-card {
    min-height: 44px;
    padding: 12px;
  }
}

.delivery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.delivery-top {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 60px;
    align-items: start;
}

@media (max-width: 968px) {
    .delivery-top {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

.map-container {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f5f9;
    height: 500px;
    position: relative;
}

#delivery-map {
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

.map-instruction {
    position: absolute;
    top: 30px;
    left: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    width: 290px;
}

.map-instruction.show {
    display: block;
}

.vehicles-section {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f5f9;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.vehicles-section h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 20px;
    text-align: center;
}

.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (max-width: 480px) {
    .vehicles-grid {
        grid-template-columns: 1fr;
    }
}

.vehicle-card {
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    /* iOS Safari touch оптимизация */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    min-height: 44px; /* iOS минимальный размер касания */
}

.vehicle-card:hover {
    border-color: #d32f2f;
    transform: translateY(-2px);
}

.vehicle-card.selected {
    border-color: #d32f2f;
    background: linear-gradient(135deg, #fef2f2, #fff);
    box-shadow: 0 8px 25px rgba(211, 47, 47, 0.15);
}

.vehicle-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 8px;
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.vehicle-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.vehicle-capacity {
    font-size: 12px;
    color: #6b7280;
}

.delivery-price {
    font-size: 18px;
    font-weight: 600;
    color: #d32f2f;
    text-align: center;
    margin-bottom: 8px;
}

.delivery-address {
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    margin-bottom: 12px;
}

.delivery-note {
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    font-style: italic;
}

.delivery-result {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f5f9;
    margin: 0 auto 40px auto;
    max-width: 800px;
    text-align: center;
}

.delivery-result h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 20px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.result-item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.result-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
}

.result-value {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.result-price {
    font-size: 28px;
    font-weight: 700;
    color: #d32f2f;
    margin: 20px 0;
}

.result-note {
    font-size: 14px;
    color: #6b7280;
    font-style: italic;
}

@media (max-width: 768px) {
    .delivery-result {
        padding: 20px 15px;
        margin: 0 15px 30px 15px;
        border-radius: 16px;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .result-item {
        padding: 12px;
    }
    
    .result-value {
        font-size: 16px;
    }
    
    .result-price {
        font-size: 24px;
        margin: 15px 0;
    }
}

@media (max-width: 480px) {
    .delivery-result {
        padding: 15px 12px;
        margin: 0 10px 25px 10px;
    }
    
    .delivery-result h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .result-price {
        font-size: 22px;
    }
}

.delivery-page {
    -webkit-overflow-scrolling: touch;
}

/* Улучшение для устройств с Dynamic Island */
@media screen and (device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) {
    .delivery-result {
        margin-bottom: calc(30px + env(safe-area-inset-bottom));
    }
}

.delivery-conditions {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f5f9;
    margin-bottom: 40px;
}

.conditions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.condition-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}
.condition-content {
    flex: 1;
}

.condition-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.condition-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #d32f2f;
}

.delivery-conditions-title{
    text-align: center;
    margin-bottom: 30px;
}

.condition-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.condition-content p {
    font-size: 16px;
    line-height: 1.6;
    color: #6b7280;
    margin: 0;
}

.payment-methods {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f5f9;
    margin-bottom: 40px;
}

.payment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.payment-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.payment-card:hover {
    border-color: #d32f2f;
    box-shadow: 0 8px 25px rgba(211, 47, 47, 0.15);
}

.payment-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.payment-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.payment-desc {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

.additional-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .additional-info {
        grid-template-columns: 1fr;
    }
}

.info-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f5f9;
}

.info-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-card h3 i {
    color: #d32f2f;
    font-size: 24px;
}

.info-card p {
    font-size: 16px;
    line-height: 1.6;
    color: #6b7280;
    margin: 0;
}

@media (max-width: 768px) {
    .delivery-conditions {
        padding: 24px;
    }

    .conditions-grid {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }

    .condition-item {
        display: flex;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        justify-content: center !important;
        gap: 15px;
        width: 100%;
        padding: 20px;
        max-width: 400px;
        margin: 0 auto;
    }

    .condition-icon {
        margin: 0 auto;
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .condition-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        width: 100%;
    }

    .condition-content h3 {
        font-size: 20px;
        font-weight: 600;
        color: #1f2937;
        margin-bottom: 12px;
        text-align: center;
        width: 100%;
    }

        .condition-content h3,
    .condition-content p {
        text-align: center !important;
        width: 100% !important;
    }

    .condition-content p {
        font-size: 16px;
        line-height: 1.6;
        color: #6b7280;
        margin: 0;
        text-align: center;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .condition-item {
        max-width: 100%;
        padding: 20px;
    }

    .condition-content h3 {
        font-size: 18px;
    }

    .condition-content p {
        font-size: 14px;
        line-height: 1.5;
    }
}

.delivery-top,
.delivery-conditions,
.payment-methods,
.additional-info {
    animation: fadeInUp 0.6s ease forwards;
}