/* ===================================================
   RESPONSIVE DESIGN & UTILITIES
   =================================================== */

/* Total Section - Left Column */
.total-section-left {
    background: #fff;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8ecef;
    margin-top: 0px;
    overflow: hidden;
}

.total-section-left h4 {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    color: #2d3748;
    padding: 1.5rem 2rem;
    margin: 0;
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: 2px solid #e8ecef;
    display: flex;
    align-items: center;
}

.total-section-left h4 i {
    color: var(--background);
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.total-content {
    padding: 1rem 1.5rem;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.total-row.voucher-applied {
    background: rgba(0, 150, 136, 0.05);
    border: 1px solid var(--background);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin: 0.5rem 0;
    font-size: 0.85rem;
}

.total-row.voucher-applied .voucher-info {
    display: block;
    align-items: left;
    gap: 0.5rem;
    color: var(--background);
    font-weight: 600;
}

.total-row.voucher-applied .voucher-code-small {
    background: var(--background);
    color: #fff;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-family: 'Courier New', monospace;
}

.total-row.voucher-applied .remove-voucher {
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 0.1rem 0.3rem;
    font-size: 0.65rem;
    cursor: pointer;
    margin-left: auto;
}

.total-row.final {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--background-error);
    border-top: 1px solid #e9ecef;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    margin-bottom: 0;
}

/* Shipping Info Compact Display */
.shipping-info {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.shipping-info h3 {
    /* background: var(--background); */
    color: #fff;
    margin: 0;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: var(--font-hel, sans-serif);
}
#editShippingBtn {
    background: var(--background);
}
.shipping-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.shipping-header h3 {
    color: #333;
    font-weight: 400;
    margin: 0;
    font-size: 1rem;
    font-family: var(--font-hel, sans-serif);
}

.edit-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #303030;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: var(--font-hel, sans-serif);
    font-weight: 500;
}

.edit-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    color: #333;
}

.edit-btn i {
    margin-right: 0.25rem;
}

.shipping-display {
    background: #fff;
    border-radius: 0;
    padding: 0;
    margin: 0;
    border: none;
}

.shipping-company {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.shipping-company i {
    color: #6c757d;
    font-size: 1.2rem;
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

.company-info {
    flex: 1;
}

.company-name {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    font-family: var(--font-hel, sans-serif);
}

.shipping-contact {
    padding: 1rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-family: var(--font-hel, sans-serif);
}

.contact-item:last-child {
    margin-bottom: 0;
}

.contact-item i {
    color: #6c757d;
    font-size: 1rem;
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.contact-item span {
    color: #333;
    flex: 1;
}

.contact-item .remark-text {
    color: #007bff;
    font-style: italic;
    background: rgba(0, 123, 255, 0.1);
    padding: 0.5rem;
    border-radius: 6px;
    border-left: 3px solid #007bff;
    margin-top: 0.25rem;
    display: block;
    font-size: 0.875rem;
    line-height: 1.4;
}

.contact-note {
    color: #6c757d;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.shipping-form {
    animation: slideDown 0.3s ease;
    padding: 1.5rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.save-btn {
    background: var(--background);
    color: #fff;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.save-btn:hover {
    background: #dc3545;
    color: #fff;
}

.cancel-btn {
    background: #6c757d;
    color: #fff;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.cancel-btn:hover {
    background: #5a6268;
}

/* Shipping Methods Visibility */
.shipping-method-hidden {
    display: none;
}

.view-all-shipping {
    border-top: 1px solid #f1f3f4;
    background: transparent;
}

.view-all-btn {
    background: transparent;
    border: none;
    color: #6c757d;
    padding: 0px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-hel, sans-serif);
    width: 100%;
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: left;
}

.view-all-btn:hover {
    color: var(--background);
}

.view-all-btn i {
    margin-right: 0.5rem;
    transition: transform 0.3s ease;
}

.view-all-btn.collapse {
    color: #495057;
    display: flex;
    justify-content: left;
}

.view-all-btn.collapse:hover {
    color: var(--background);
}

.view-all-btn.collapse i {
    transform: rotate(180deg);
}

/* Shipping methods animation */
.shipping-method-hidden {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transform: translateY(-10px);
    transition: all 0.4s ease;
    pointer-events: none;
}

.shipping-method-hidden.show {
    opacity: 1;
    max-height: 200px;
    transform: translateY(0);
    pointer-events: auto;
}

/* Address Selector */
.address-selector {
    position: relative;
    cursor: pointer;
}

.address-selector input {
    cursor: pointer;
    padding-right: 2.5rem;
}

.address-selector i {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Popup */
.popup_pay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}

.popup_pay.active {
    display: flex;
}

.popup_pay .content {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 350px;
    width: 90%;
}

/* Address Popup */
.address-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.address-popup.active {
    display: flex;
}

.address-popup-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.address-popup-header {
    background: var(--background);
    color: #fff;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.address-popup-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.address-popup-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.address-popup-body {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

.address-search {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    background: #fff;
}

.address-search:focus {
    border-color: var(--background);
    outline: none;
    box-shadow: 0 0 0 0.1rem rgba(0, 150, 136, 0.15);
}

.address-list {
    max-height: 300px;
    overflow-y: auto;
}

.address-item {
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.address-item:hover,
.address-item.selected {
    border-color: var(--background);
    background: rgba(0, 150, 136, 0.05);
}

.address-item.selected {
    background: rgba(0, 150, 136, 0.1);
    border-color: var(--background);
    position: relative;
}

.address-item.selected::after {
    content: "✓";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--background);
    font-weight: bold;
}

.address-item:last-child {
    margin-bottom: 0;
}

.address-breadcrumb {
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.85rem;
    color: #6c757d;
}

.address-breadcrumb .breadcrumb-item {
    display: inline;
    cursor: pointer;
    color: var(--background);
    text-decoration: none;
}

.address-breadcrumb .breadcrumb-item:hover {
    color: var(--bghover);
}

.address-breadcrumb .breadcrumb-separator {
    margin: 0 0.5rem;
    color: #6c757d;
}

.address-popup-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 0.75rem;
}

.address-popup-footer button {
    flex: 1;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.address-popup-footer .btn-cancel {
    background: #6c757d;
    color: #fff;
}

.address-popup-footer .btn-confirm {
    background: var(--background);
    color: #fff;
}

.address-popup-footer button:hover {
    opacity: 0.9;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 350px;
    word-wrap: break-word;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.3);
}

.notification.success::before {
    content: '✓';
    font-weight: bold;
    font-size: 1rem;
}

.notification.error {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    box-shadow: 0 4px 20px rgba(244, 67, 54, 0.3);
}

.notification.error::before {
    content: '⚠';
    font-weight: bold;
    font-size: 1rem;
}

.hide-for-large-up {
    display: none !important;
}

.item-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* Overrides for existing styles */
#payment {
    background: transparent !important;
}

.pricing-table {
    border: none !important;
}

.title-payment {
    background: var(--background) !important;
    color: #fff !important;
    border-radius: 8px 8px 0 0 !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.9rem !important;
}

.bullet-item {
    background: #fff !important;
    border-radius: 8px !important;
    margin-bottom: 0.75rem !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

#coupon_cart_a {
    background: var(--background) !important;
    border-radius: 0 6px 6px 0 !important;
    width: 100%;
    height: 46px;
}

#coupon_cart {
    border-radius: 6px 0 0 6px !important;
    border: 1px solid #e9ecef !important;
    font-family: var(--font-hel, sans-serif) !important;
    height: 46px;
}

.button.payging {
    background: var(--background) !important;
    border-radius: 8px !important;
    padding: 0.8rem 1rem !important;
    font-size: 0.9rem !important;
}

.form-control {
    border: 1px solid #e9ecef !important;
    border-radius: 6px !important;
    padding: 0.6rem 0.8rem !important;
    font-size: 0.85rem !important;
}

.form-control:focus {
    border-color: var(--background) !important;
    box-shadow: 0 0 0 0.1rem rgba(0, 150, 136, 0.15) !important;
}

select {
    border: 1px solid #e9ecef !important;
    border-radius: 6px !important;
    padding: 0.6rem 0.8rem !important;
    font-size: 0.85rem !important;
}

.info-payment div {
    border: 1px solid #e9ecef !important;
    border-radius: 8px !important;
    margin-bottom: 0.5rem !important;
    padding: 0.75rem !important;
}

.info-payment div:hover,
.info-payment div.active {
    border-color: var(--background) !important;
    background: rgba(0, 150, 136, 0.05) !important;
}

.ship_method {
    border: 1px solid #e9ecef !important;
    border-radius: 8px !important;
    margin-bottom: 0.5rem !important;
    padding: 0.75rem !important;
}

.ship_method:hover,
.ship_method.active {
    border-color: var(--background) !important;
    background: rgba(0, 150, 136, 0.05) !important;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .cart-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .total-section-left {
        position: fixed;
        bottom: 70px;
        left: 0;
        right: 0;
        z-index: 1000;
        width: 100%;
        max-width: 100%;
    }
    .checkout-section {
        position: static;
        order: 2;
    }

    .cart-items-section {
        order: 1;
        border-radius: 3px;
    }
}

@media (max-width: 768px) {
    .voucher-in-cart-left .list-voucher {
        padding: 12px;
    }
    .cart-wrapper {
        padding: 0 0.5rem;
        padding-bottom: 50px;
    }
    .payment-methods h3 {
        padding: 1rem !important;
    }
    .cart-header h1 {
        font-size: 1.5rem;
    }

    .section-body {
        padding: 12px;
    }

    .coupon-input-group {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .cart-content {
        gap: 0.75rem;
    }

    .shipping-company {
        padding: 0.75rem;
    }

    .shipping-contact {
        padding: 0.75rem;
    }

    .contact-item {
        margin-bottom: 0.5rem;
        font-size: 0.8rem;
    }
    
    .contact-item .remark-text {
        font-size: 0.8rem;
        padding: 0.4rem;
        margin-top: 0.2rem;
        border-radius: 4px;
        line-height: 1.3;
    }

    .voucher-in-cart-left,
    .total-section-left {
        margin-top: 20px;
    }

    .form-actions {
        flex-direction: column;
    }

    /* Mobile cart items */
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .cart-item-left {
        width: 100%;
    }

    .cart-item-right {
        width: 100%;
        justify-content: space-between;
    }

    .cart-item img {
        width: 60px;
        height: 60px;
    }

    .cart-item-name {
        font-size: 0.85rem;
    }

    /* Mobile voucher scroll */
    /* .voucher-item {
        min-width: 240px;
        width: 240px;
        height: 130px;
    } */

    .voucher-content {
        padding: 0.7rem;
    }

    .voucher-item:hover {
        transform: translateY(-3px) scale(1.02);
    }

    /* .voucher-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        margin-bottom: 0.5rem;
    } */

    .voucher-code {
        max-width: 112px;
        font-size: 0.85rem;
    }

    .voucher-discount {
        font-size: 0.65rem;
        padding: 0px;
    }

    .voucher-description {
        font-size: 0.7rem;
        margin-bottom: 0.5rem;
    }

    .voucher-expiry {
        font-size: 0.6rem;
    }

    .coupon-input-group {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .coupon-btn {
        width: 100%;
        padding: 0.9rem;
    }

    #payging_btn {
        margin: 0px !important;
        width: 100% !important;
    }

    #payging_btn span, #payging_btn i {
        font-size: 1rem !important;
        color: #fff !important;
    }

    .form-group.grid-2 {
        grid-template-columns: 1fr;
    }

    .hide-for-large-up {
        display: block !important;
    }
}

@media (max-width: 600px) {
    .hide-for-large-up {
        display: block !important;
    }
}

/* ===================================================
   ADDITIONAL STYLES FROM HTML
   =================================================== */

form.form-review.show {
    transition: 0.5s all;
    display: block !important;
}

div.btn_danhmuc {
    display: block;
    z-index: 55555555;
} 