html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    /* Ensure html/body don't create containing block for fixed elements */
    transform: none !important;
    perspective: none !important;
    will-change: auto !important;
    filter: none !important;
    backdrop-filter: none !important;
    isolation: auto !important;
}

/* WRAPPER */
.cart-wrapper {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
    /* Ensure no transform or perspective that would create new containing block */
    transform: none !important;
    perspective: none !important;
    filter: none !important;
    backdrop-filter: none !important;
    isolation: auto !important;
    position: relative;
}

.cart-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    /* Ensure no transform or perspective that would create new containing block */
    transform: none !important;
    perspective: none !important;
    will-change: auto;
    /* Remove any properties that could create containing block */
    filter: none !important;
    backdrop-filter: none !important;
    isolation: auto !important;
    contain: none !important;
}

/* Ensure payment summary is taken out of grid flow and truly fixed */
.cart-container > .payment-summary-section {
    position: fixed !important;
    grid-column: unset !important;
    grid-row: unset !important;
    left: auto !important;
    bottom: auto !important;
    /* Remove from document flow completely */
    float: none !important;
    clear: none !important;
    /* Ensure it's positioned relative to viewport, not parent */
    top: 200px !important;
    right: 20px !important;
    z-index: 9999 !important;
}

@media (max-width: 1024px) {
    .cart-container {
        grid-template-columns: 1fr;
    }
}

/* SECTION TITLE */
.section-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

/* Smaller section titles for delivery and payment */
.delivery-section .section-title,
.payment-section .section-title {
    font-size: 20px;
    margin-bottom: 15px;
    padding-bottom: 10px;
}

/* ORDER SECTION */
.order-section {
    grid-column: 1;
}

.empty-cart {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-cart i {
    font-size: 64px;
    margin-bottom: 20px;
    color: #ddd;
}

.empty-cart p {
    font-size: 18px;
    margin-bottom: 20px;
}

.continue-shopping-btn {
    display: inline-block;
    padding: 12px 30px;
    background: #333;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.continue-shopping-btn:hover {
    background: #555;
    transform: translateY(-2px);
}

.order-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.order-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    position: relative;
    transition: all 0.3s ease;
}

.order-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #ccc;
}

.item-image-wrapper {
    position: relative;
    flex-shrink: 0;
}

.item-image-wrapper img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    background: #f0f0f0;
}

.remove-item-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e74c3c;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3);
}

.remove-item-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.item-color,
.item-size {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.item-price {
    margin-top: 8px;
}

.current-price {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.original-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
    margin-left: 10px;
}

.price-hidden {
    color: #999;
    font-style: italic;
}

.item-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 12px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 4px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: white;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 14px;
}

.qty-btn:hover {
    background: #f0f0f0;
}

.qty-value {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    color: #333;
}


/* PAYMENT SUMMARY SECTION */
.payment-summary-section {
    /* Remove from grid completely */
    grid-column: unset !important;
    grid-row: unset !important;
    
    /* Fixed positioning - relative to viewport, not parent */
    position: fixed !important;
    top: 200px !important;
    right: 20px !important;
    left: auto !important;
    bottom: auto !important;
    
    /* Styling */
    background: #fafafa !important;
    padding: 25px !important;
    border-radius: 8px !important;
    border: 1px solid #e0e0e0 !important;
    width: 380px !important;
    min-width: 380px !important;
    max-width: 380px !important;
    height: fit-content !important;
    max-height: calc(100vh - 220px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    
    /* Z-index and visual */
    z-index: 9999 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    
    /* Remove any transforms that might create containing block */
    transform: none !important;
    -webkit-transform: none !important;
    -moz-transform: none !important;
    -ms-transform: none !important;
    will-change: auto !important;
    
    /* Remove margins and alignment */
    margin: 0 !important;
    align-self: unset !important;
    justify-self: unset !important;
    
    /* Ensure it's not affected by parent positioning */
    contain: layout style paint !important;
    
    /* Additional properties to ensure fixed positioning */
    float: none !important;
    clear: none !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Calculate right position for larger screens with centered container */
@media (min-width: 1440px) {
    .payment-summary-section {
        right: calc((100vw - 1440px) / 2 + 20px) !important;
        max-width: 380px;
    }
}

@media (min-width: 1600px) {
    .payment-summary-section {
        right: calc((100vw - 1400px) / 2 + 20px) !important;
    }
}

/* Adjust for smaller screens */
@media (max-width: 1024px) {
    .payment-summary-section {
        position: static !important;
        width: 100%;
        right: auto !important;
        top: auto !important;
        max-height: none;
        box-shadow: none;
        z-index: auto;
    }
}

.account-status {
    margin-bottom: 20px;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.registered {
    background: #27ae60;
    color: white;
}

.status-badge.unregistered {
    background: #e74c3c;
    color: white;
}

.transaction-code {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
    font-size: 14px;
}

.code-value {
    font-weight: 600;
    color: #333;
    font-family: monospace;
}

.coupon-section {
    margin-bottom: 20px;
}

.coupon-section label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.coupon-input-group {
    display: flex;
    gap: 8px;
}

.coupon-input-group input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.apply-coupon-btn {
    padding: 10px 20px;
    background: #333;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.apply-coupon-btn:hover {
    background: #555;
}

.summary-breakdown {
    margin: 20px 0;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    color: #666;
}

.summary-row.total-amount {
    font-weight: 700;
    font-size: 18px;
    color: #333;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #e0e0e0;
}

.total-amount {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

/* DELIVERY SECTION */
.delivery-section {
    grid-column: 1 / -1;
    margin-top: 20px;
}

.delivery-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.delivery-option {
    display: block;
    cursor: pointer;
}

.delivery-option input[type="radio"] {
    display: none;
}

.delivery-option-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: white;
}

.delivery-option input[type="radio"]:checked + .delivery-option-content {
    border-color: #3498db;
    background: #f0f8ff;
}

.delivery-logo {
    width: 45px;
    height: 45px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: white;
    flex-shrink: 0;
}

.delivery-logo.dpd {
    background: linear-gradient(135deg, #dc143c 0%, #b71c1c 100%);
}

.delivery-logo.ups {
    background: linear-gradient(135deg, #7b2cbf 0%, #5a189a 100%);
}

.delivery-logo.fedex {
    background: linear-gradient(135deg, #4d148c 0%, #6600cc 100%);
}

.delivery-logo.collect {
    background: linear-gradient(135deg, #8b4513 0%, #654321 100%);
    font-size: 18px;
}

.delivery-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.delivery-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.delivery-date {
    font-size: 12px;
    color: #666;
}

.delivery-price {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.delivery-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.delivery-option input[type="radio"]:checked + .delivery-option-content .delivery-check {
    background: #3498db;
}

.delivery-option input[type="radio"]:not(:checked) + .delivery-option-content .delivery-check {
    display: none;
}

/* ADDITIONAL SERVICE SECTION */
.additional-service-section {
    grid-column: 1 / -1;
    margin-top: 30px;
}

.service-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.service-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.service-option:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.service-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.service-name {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.service-desc {
    font-size: 14px;
    color: #666;
}

.service-price {
    font-weight: 600;
    color: #333;
    font-size: 16px;
    margin-left: 15px;
    min-width: 60px;
    text-align: right;
}

/* TOGGLE SWITCH */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    margin: 0 15px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #3498db;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* PAYMENT SECTION */
.payment-section {
    grid-column: 1 / -1;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.payment-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.payment-method-selection {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.payment-method-option {
    flex: 1;
    display: block;
    cursor: pointer;
}

.payment-method-option input[type="radio"] {
    display: none;
}

.payment-method-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
}

.payment-method-option input[type="radio"]:checked + .payment-method-label {
    border-color: #3498db;
    background: #e8f4f8;
    color: #3498db;
}

.payment-method-label i {
    font-size: 20px;
}

.payment-form {
    background: #fafafa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.bank-details {
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.bank-details h3 {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.bank-input {
    background: #f8f9fa;
    cursor: not-allowed;
    color: #495057;
}

.bank-input:focus {
    outline: none;
    border-color: #ddd;
    box-shadow: none;
}

.bank-note {
    margin-top: 20px;
    padding: 15px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    display: flex;
    gap: 10px;
}

.bank-note i {
    color: #856404;
    font-size: 18px;
    flex-shrink: 0;
}

.bank-note p {
    margin: 0;
    font-size: 13px;
    color: #856404;
    line-height: 1.5;
}

/* FILE UPLOAD SECTION */
.file-upload-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid #e0e0e0;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.file-upload-label:hover {
    border-color: #3498db;
    background: #f0f8ff;
}

.file-upload-label i {
    font-size: 32px;
    color: #3498db;
    margin-bottom: 10px;
}

.file-upload-label span:first-of-type {
    font-weight: 600;
    color: #333;
    font-size: 16px;
    margin-bottom: 5px;
}

.file-upload-hint {
    font-size: 12px;
    color: #999;
    font-weight: normal;
}

.file-preview {
    margin-top: 15px;
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #e8f4f8;
    border: 1px solid #3498db;
    border-radius: 6px;
}

.file-preview-item i {
    font-size: 20px;
    color: #3498db;
}

.file-preview-item span {
    flex: 1;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.remove-file-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

.remove-file-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.file-upload-info {
    margin-top: 10px;
    text-align: center;
}

.file-upload-info small {
    color: #999;
    font-size: 12px;
}

.checkout-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Make Bootstrap cards in payment section more compact */
.payment-section .card {
    margin-bottom: 15px !important;
}

.payment-section .card-body {
    padding: 15px !important;
}

.payment-section .card-title {
    font-size: 16px !important;
    margin-bottom: 15px !important;
}

.payment-section .form-label {
    font-size: 13px !important;
    margin-bottom: 6px !important;
}

.payment-section .form-control-lg {
    padding: 10px 12px !important;
    font-size: 14px !important;
}

.payment-section .mb-3 {
    margin-bottom: 12px !important;
}

.payment-section .mb-4 {
    margin-bottom: 15px !important;
}

.checkout-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .cart-wrapper {
        margin: 20px auto;
        padding: 0 10px;
    }
    
    .cart-container {
        padding: 20px;
        gap: 20px;
    }
    
    .order-item {
        flex-direction: column;
    }
    
    .item-image-wrapper img {
        width: 100%;
        height: 200px;
    }
    
    .item-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .payment-summary-section {
        position: static;
        max-height: none;
        width: 100%;
        right: auto;
        top: auto;
        box-shadow: none;
    }
    
    .delivery-option-content {
        flex-wrap: wrap;
    }
    
    .service-option {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .payment-method-selection {
        flex-direction: column;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}
