/**
 * Redesigned Delivery Info Styles
 */

/* Cart Delivery Notice - Professional Design */
.cart-delivery-notice {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.cart-delivery-notice::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #ff6b35;
}

.cart-delivery-notice .d-flex {
    gap: 20px;
}

/* Icon Wrapper */
.delivery-icon-wrapper {
    background: #ff6b35;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.delivery-icon-wrapper i {
    font-size: 32px;
    color: white;
}

/* Content Area */
.delivery-content {
    padding-right: 20px;
}

.delivery-title {
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.delivery-details {
    margin-bottom: 15px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #546e7a;
    font-size: 14px;
}

.detail-item i {
    font-size: 18px;
    color: #78909c;
}

.delivery-warning {
    background: #fff8e1;
    border: 1px solid #ffecb3;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.delivery-warning i {
    color: #ff8f00;
    font-size: 20px;
}

.delivery-warning span {
    color: #5d4037;
    font-size: 14px;
    font-weight: 500;
}

/* Action Button Area */
.delivery-action {
    display: flex;
    align-items: center;
}

.view-delivery-requirements {
    background: #ff6b35;
    border: none;
    border-radius: 50px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);
}

.view-delivery-requirements:hover {
    background: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.35);
}

.view-delivery-requirements i {
    font-size: 20px;
}

.view-delivery-requirements.btn-success {
    background: #28a745;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.25);
}

.view-delivery-requirements.btn-success:hover {
    background: #218838;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.35);
}

/* Modal Enhancements */
#deliveryInfoModal .modal-dialog {
    max-width: 900px;
}

#deliveryInfoModal .modal-header {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    border-bottom: none;
    padding: 20px 30px;
}

#deliveryInfoModal .modal-header .close {
    color: white;
    opacity: 0.8;
    font-size: 28px;
}

#deliveryInfoModal .modal-header .close:hover {
    opacity: 1;
}

#deliveryInfoModal .modal-title {
    display: flex;
    align-items: center;
    font-size: 22px;
    font-weight: 600;
}

#deliveryInfoModal .modal-title i {
    margin-right: 12px;
    font-size: 28px;
}

#deliveryInfoModal .modal-body {
    padding: 30px;
}

#deliveryInfoModal .delivery-acceptance {
    background: #f0f7ff;
    border: 2px solid #2196f3;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

#deliveryInfoModal .custom-control-label {
    cursor: pointer;
    user-select: none;
    padding-left: 10px;
}

#deliveryInfoModal .custom-control-label strong {
    color: #1976d2;
    font-size: 16px;
}

#deliveryInfoModal .custom-control-label ul {
    margin-left: 20px;
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.8;
    color: #455a64;
}

#deliveryInfoModal .custom-control-label ul li {
    margin-bottom: 5px;
}

#deliveryInfoModal .custom-control-input:checked ~ .custom-control-label::before {
    background-color: #2196f3;
    border-color: #2196f3;
}

#deliveryInfoModal .modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 20px 30px;
}

#deliveryInfoModal .btn-confirm-delivery {
    background: #28a745;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
}

#deliveryInfoModal .btn-confirm-delivery:not(:disabled):hover {
    background: #218838;
    transform: scale(1.05);
}

#deliveryInfoModal .btn-confirm-delivery:disabled {
    background: #cccccc;
    opacity: 0.6;
    cursor: not-allowed;
}

/* Fixed Timeline styling */
.delivery-timeline {
    position: relative;
    padding-left: 60px;
    margin: 30px 0;
}

.timeline-item {
    position: relative;
    padding-bottom: 40px;
    display: flex;
    align-items: flex-start;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item:not(:last-child):after {
    content: '';
    position: absolute;
    left: -40px;
    top: 45px;
    height: calc(100% - 45px);
    width: 2px;
    background: #e0e0e0;
}

.timeline-badge {
    position: absolute;
    left: -50px;
    top: 0;
    width: 40px;
    height: 40px;
    background: #ff6b35;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    z-index: 1;
}

.timeline-content {
    flex: 1;
    padding-top: 5px;
}

.timeline-content h6 {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 16px;
}

.timeline-content p {
    color: #546e7a;
    margin-bottom: 0;
    font-size: 14px;
}

/* Accordion styling */
#deliveryAccordion .card {
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

#deliveryAccordion .card-header {
    background: #f8f9fa;
    padding: 0;
    border-bottom: none;
}

#deliveryAccordion .btn-link {
    color: #2c3e50;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    width: 100%;
    text-align: left;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.3s ease;
}

#deliveryAccordion .btn-link:hover {
    background: #e8f5e9;
    color: #1b5e20;
}

#deliveryAccordion .btn-link:focus {
    box-shadow: none;
    outline: none;
}

#deliveryAccordion .btn-link i {
    font-size: 24px;
    color: #78909c;
}

#deliveryAccordion .card-body {
    padding: 20px 24px;
    color: #455a64;
    line-height: 1.6;
}

/* Checkout button disabled state */
.checkout a.disabled {
    cursor: not-allowed !important;
    opacity: 0.6;
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    position: relative;
}

.checkout-disabled-notice {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dc3545;
    margin-top: 10px;
}

.checkout-disabled-notice i {
    font-size: 18px;
    margin-right: 6px;
}

/* Delivery images */
.delivery-images {
    text-align: center;
    margin-bottom: 30px;
}

.delivery-images img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Contact info box */
.delivery-contact-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
}

.delivery-contact-info h5 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
}

.delivery-contact-info p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    color: #455a64;
}

.delivery-contact-info i {
    margin-right: 10px;
    color: #ff6b35;
    font-size: 20px;
}

.delivery-contact-info a {
    color: #1976d2;
    font-weight: 500;
}

.delivery-contact-info a:hover {
    color: #1565c0;
}

/* Responsive design */
@media (max-width: 768px) {
    .cart-delivery-notice {
        padding: 20px;
    }
    
    .cart-delivery-notice .d-flex {
        flex-direction: column;
        gap: 15px;
    }
    
    .delivery-content {
        padding-right: 0;
    }
    
    .delivery-action {
        width: 100%;
    }
    
    .view-delivery-requirements {
        width: 100%;
        justify-content: center;
    }
    
    .timeline-badge {
        left: -35px;
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .timeline-item:not(:last-child):after {
        left: -30px;
        top: 35px;
        height: calc(100% - 35px);
    }
    
    .delivery-timeline {
        padding-left: 45px;
    }
    
    #deliveryAccordion .btn-link {
        font-size: 14px;
        padding: 14px 18px;
    }
    
    #deliveryInfoModal .modal-header {
        padding: 15px 20px;
    }
    
    #deliveryInfoModal .modal-title {
        font-size: 18px;
    }
    
    #deliveryInfoModal .modal-body {
        padding: 20px;
    }
}

/* Info note for cart - non-blocking */
.delivery-info-note {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.delivery-info-note i {
    color: #1976d2;
    font-size: 20px;
}

.delivery-info-note span {
    color: #0d47a1;
    font-size: 14px;
    font-weight: 500;
}

/* Accordion arrow indicators */
#deliveryAccordion .btn-link {
    position: relative;
    padding-right: 30px;
}

#deliveryAccordion .btn-link:after {
    content: "\f078"; /* Font Awesome down arrow */
    font-family: "FontAwesome";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
}

#deliveryAccordion .btn-link[aria-expanded="true"]:after {
    transform: translateY(-50%) rotate(180deg);
}

/* Ensure smooth transitions */
#deliveryAccordion .collapse {
    transition: height 0.35s ease;
}

#deliveryAccordion .collapsing {
    position: relative;
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
}

/* Info sections styling */
.delivery-info-sections .info-section {
    border-left: 4px solid #2fb5d2;
    padding-left: 20px;
    margin-bottom: 30px;
}

.delivery-info-sections .section-title {
    color: #2fb5d2;
    margin-bottom: 15px;
    font-weight: 600;
}

.delivery-info-sections .section-content {
    color: #333;
    line-height: 1.6;
}

/* Modal scrolling for long content */
#deliveryInfoModal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* Make modal wider for better readability */
@media (min-width: 992px) {
    #deliveryInfoModal .modal-dialog {
        max-width: 900px;
    }
}

/* Payment button disabled state */
.delivery-blocked {
    opacity: 0.6;
    cursor: not-allowed !important;
}

.delivery-warning {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.delivery-warning .material-icons {
    font-size: 18px;
}

/* Success state */
#delivery-confirmation-status .alert {
    display: flex;
    align-items: center;
    gap: 10px;
}

#delivery-confirmation-status .material-icons {
    color: #4caf50;
}