/* SweetAlert2 popup */
.swal2-container {
    z-index: 999999 !important;
}

/* Cart Section */
.cart-section {
    padding: 40px 0;
    min-height: 60vh;
}

.cart-section h2 {
    font-size: 32px;
    margin-bottom: 30px;
    color: #333;
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 60px 20px;
}

.empty-cart i {
    font-size: 80px;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-cart h3 {
    font-size: 24px;
    color: #555;
    margin-bottom: 10px;
}

.empty-cart p {
    color: #777;
    margin-bottom: 30px;
}

/* Cart Table */
.cart-table-wrapper {
    overflow-x: auto;
    margin-bottom: 30px;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cart-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
}

.cart-table td {
    padding: 20px 15px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.product-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.product-info img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.product-details h4 {
    font-size: 16px;
    margin-bottom: 5px;
    color: #333;
}

.product-details .category {
    font-size: 14px;
    color: #666;
}

.price {
    font-size: 18px;
    font-weight: 600;
    color: #c82333;
}

.item-total {
    font-size: 18px;
    font-weight: 700;
    color: #c82333;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.qty-btn:hover {
    background: #fae01a;
    color: white;
    border-color: #fae01a;
}

.qty-input {
    width: 60px;
    height: 32px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.remove-btn:hover {
    background: #c82333;
}

/* Cart Summary */
.cart-summary {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin-left: auto;
}

.cart-summary h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 16px;
}

.summary-row.total {
    font-size: 20px;
    font-weight: 700;
    color: #c82333;
    margin-top: 15px;
}

.cart-summary hr {
    border: none;
    border-top: 2px solid #dee2e6;
    margin: 20px 0;
}

.checkout-btn {
    width: 100%;
    background: #c82333;
    color: white;
    border: none;
    padding: 15px;
    font-size: 18px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s;
}

.continue-shopping {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: #c82333;
    text-decoration: none;
}

.continue-shopping:hover {
    text-decoration: underline;
}

/* Checkout Modal */
.checkout-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: #fefefe;
    margin: 3% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: #fae01a;
    color: white;
    padding: 20px 30px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    padding: 0 !important;
    font-size: 24px;
    color: #c82333;
}

.close-modal {
    color: #c82333;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.close-modal:hover {
    opacity: 0.8;
}

.modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group label .required {
    color: #dc3545;
    margin-left: 3px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #fae01a;
}

.form-group input.error,
.form-group textarea.error,
.form-group select.error {
    border-color: #dc3545;
}

.form-group .error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.form-group input.error+.error-message,
.form-group textarea.error+.error-message,
.form-group select.error+.error-message {
    display: block;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.order-summary-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.order-summary-box h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.order-summary-box .summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.order-summary-box .summary-total {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #dee2e6;
    font-weight: 700;
    font-size: 18px;
    color: #c82333;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-cancel {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.btn-cancel:hover {
    background: #5a6268;
}

.btn-submit {
    background: #c82333;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.btn-submit:hover {
    background: #234d24;
}

.btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .cart-table {
        font-size: 14px;
    }

    .product-info {
        flex-direction: column;
        text-align: center;
    }

    .product-info img {
        width: 60px;
        height: 60px;
    }

    .cart-summary {
        max-width: 100%;
        margin-top: 30px;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-body {
        padding: 20px;
    }
}

/* Checkout Modal Updates */

.checkout-modal .modal-content {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Checkout Sections */
.checkout-section {
    margin-bottom: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    height: 300px;
    overflow-y: scroll;
}

.checkout-section h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkout-section h3 i {
    color: #3498db;
    font-size: 20px;
}

/* Address List */
.address-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.address-card {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.address-card:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
}

.address-card.selected {
    border-color: #3498db;
    background: #e3f2fd;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.address-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
}

.address-header input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: #3498db;
    cursor: pointer;
}

.address-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

.address-body p {
    margin: 8px 0;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

.address-body p:first-child {
    font-weight: 600;
    color: #2c3e50;
}

.address-body i {
    color: #3498db;
    width: 16px;
    margin-right: 8px;
}

.no-address {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 10px;
}

.no-address i {
    font-size: 60px;
    color: #95a5a6;
    margin-bottom: 15px;
}

.no-address p {
    color: #7f8c8d;
    margin-bottom: 20px;
}

.btn-add-address {
    padding: 12px 30px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-add-address:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* Payment Options */
.payment-options {
    display: grid;
    gap: 15px;
}

.payment-option {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.payment-option:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.1);
}

.payment-option.active {
    border-color: #3498db;
    background: #e3f2fd;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.payment-option-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.payment-option input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: #3498db;
    cursor: pointer;
}

.payment-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.payment-info>i {
    font-size: 32px;
    color: #3498db;
    width: 40px;
    text-align: center;
}

.payment-info h4 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

.payment-info p {
    margin: 0;
    color: #7f8c8d;
    font-size: 14px;
}

/* QR Code Section */
.qr-code-section {
    margin-top: 20px;
    padding: 25px;
    background: white;
    border-radius: 10px;
    border: 2px solid #3498db;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.qr-code-container {
    text-align: center;
}

.qr-code-container h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 18px;
}

.qr-code {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

.qr-code img {
    display: block;
    max-width: 100%;
    height: auto;
}

.qr-amount {
    font-size: 20px;
    color: #2c3e50;
    margin: 15px 0;
}

.qr-amount strong {
    color: #27ae60;
    font-size: 24px;
}

.qr-instruction {
    color: #7f8c8d;
    font-size: 14px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.qr-instruction i {
    color: #3498db;
    font-size: 16px;
}

/* Order Note */
.order-note-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
}

.order-note-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.character-count {
    display: block;
    text-align: right;
    color: #95a5a6;
    font-size: 12px;
    margin-top: 5px;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 30px;
    color: #7f8c8d;
}

.loading i {
    font-size: 24px;
    margin-right: 10px;
}

/* Modal Footer Updates */
.modal-footer {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 20px 30px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.btn-cancel,
.btn-submit {
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-cancel {
    background: #e9ecef;
    color: #495057;
}

.btn-cancel:hover {
    background: #dee2e6;
    transform: translateY(-2px);
}

.btn-submit {
    background: #27ae60;
    color: white;
    flex: 1;
}

.btn-submit:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.btn-submit:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

/* Order Summary Box Updates */
.order-summary-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.order-summary-box h4 {
    margin: 0 0 20px 0;
    color: white;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.order-summary-box .summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    opacity: 0.9;
}

.order-summary-box .summary-total {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 20px;
    font-weight: 700;
}

/* Responsive Design */
@media (max-width: 768px) {
    .checkout-modal .modal-content {
        max-width: 95%;
        margin: 20px;
    }

    .address-list {
        grid-template-columns: 1fr;
    }

    .modal-footer {
        flex-direction: column;
    }

    .btn-submit {
        width: 100%;
    }

    .qr-code-section {
        padding: 15px;
    }

    .checkout-section {
        padding: 15px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.address-card,
.payment-option {
    animation: fadeIn 0.3s ease;
}

/* Additional CSS for Address Cards with Tags */

.address-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.address-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.address-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.address-header input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #4CAF50;
}

.address-tag-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.address-tag-badge i {
    font-size: 0.9rem;
}

.address-body {
    padding-left: 32px;
}

.address-body p {
    margin: 8px 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #555;
    line-height: 1.5;
}

.address-body p i {
    color: #667eea;
    margin-top: 3px;
    font-size: 0.95rem;
    min-width: 16px;
}

.address-text {
    font-size: 1rem;
    font-weight: 500;
    color: #333 !important;
}

.address-location {
    font-size: 0.9rem;
    color: #666 !important;
}

.address-card.selected {
    border: 2px solid #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.address-card.selected .address-tag-badge {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

/* Loading state */
.address-list .loading {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.1rem;
}

.address-list .loading i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

/* No address state */
.no-address {
    text-align: center;
    padding: 40px;
}

.no-address i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 20px;
}

.no-address p {
    color: #999;
    margin-bottom: 20px;
}

.btn-add-address {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-add-address:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .address-tag-badge {
        font-size: 0.75rem;
        padding: 5px 10px;
    }

    .address-body {
        padding-left: 28px;
    }

    .address-text {
        font-size: 0.9rem;
    }

    .address-location {
        font-size: 0.85rem;
    }
}