/* Cart Page Styles Additions */
.cart-layout {
    display: flex;
    gap: 30px;
    margin-bottom: 60px;
}

.cart-main {
    flex-grow: 1;
}

.cart-sidebar {
    width: 350px;
    flex-shrink: 0;
}

.cart-table-wrapper {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table th {
    background: var(--light-bg);
    color: var(--primary-blue);
    font-weight: 700;
    text-align: right;
    padding: 18px 20px;
    font-size: 1rem;
    border-bottom: 2px solid var(--border-color);
}

[dir="ltr"] .cart-table th {
    text-align: left;
}

.cart-table td {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.cart-table tr:last-child td {
    border-bottom: none;
}

.cart-product {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-product img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.cart-product-title {
    font-weight: 700;
    color: var(--primary-blue);
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.cart-product-cat {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.qty-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    width: 120px;
    height: 40px;
}

.qty-control button {
    width: 35px;
    height: 100%;
    background: var(--light-bg);
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
}

.qty-control button:hover {
    background: #e0e0e0;
}

.qty-control input {
    width: 50px;
    height: 100%;
    border: none;
    text-align: center;
    font-weight: 700;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    outline: none;
}

.remove-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.remove-btn:hover {
    background: var(--danger-color);
    color: var(--white);
    transform: scale(1.1);
}

.cart-summary {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    position: sticky;
    top: 100px;
}

.summary-title {
    color: var(--primary-blue);
    font-size: 1.3rem;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    color: var(--text-dark);
    font-size: 1.05rem;
}

.summary-row.total-row {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px dashed var(--border-color);
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--primary-orange);
}

.promo-box {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    margin-top: 20px;
}

.promo-box input {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    outline: none;
    font-family: var(--font-family);
    transition: var(--transition);
}

.promo-box input:focus {
    border-color: var(--primary-orange);
}

.promo-box button {
    padding: 10px 20px;
    background: var(--text-dark);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: 600;
    transition: var(--transition);
}

.promo-box button:hover {
    background: var(--primary-blue);
}

.empty-cart {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.empty-cart i {
    font-size: 6rem;
    color: var(--border-color);
    margin-bottom: 25px;
}

.empty-cart h2 {
    color: var(--primary-blue);
    font-size: 2rem;
    margin-bottom: 15px;
}

.empty-cart p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

@media(max-width: 992px) {
    .cart-layout {
        flex-direction: column;
    }

    .cart-sidebar {
        width: 100%;
    }
}

@media(max-width: 768px) {
    .cart-table thead {
        display: none;
    }

    .cart-table,
    .cart-table tbody,
    .cart-table tr,
    .cart-table td {
        display: block;
        width: 100%;
    }

    .cart-table tr {
        margin-bottom: 20px;
        border: 1px solid var(--border-color);
        border-radius: var(--radius);
        background: var(--light-bg);
    }

    .cart-table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border-bottom: 1px solid var(--border-color);
    }

    [dir="ltr"] .cart-table td {
        text-align: left;
        padding-left: 20px;
        padding-right: 50%;
    }

    .cart-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 20px;
        width: 45%;
        font-weight: 700;
        text-align: left;
        color: var(--text-muted);
    }

    [dir="ltr"] .cart-table td::before {
        left: auto;
        right: 20px;
        text-align: right;
    }

    .cart-product {
        justify-content: flex-end;
    }

    [dir="ltr"] .cart-product {
        justify-content: flex-start;
    }

    .qty-control {
        margin-right: auto;
    }

    [dir="ltr"] .qty-control {
        margin-right: 0;
        margin-left: auto;
    }
}

/* ========================================================================= */
/* ========================= CHECKOUT PAGE STYLES ========================== */
/* ========================================================================= */

.checkout-layout {
    display: flex;
    gap: 30px;
    margin-bottom: 60px;
    align-items: flex-start;
}

.checkout-main {
    flex-grow: 1;
}

.checkout-sidebar {
    width: 350px;
    flex-shrink: 0;
    position: sticky;
    /* Make the order summary follow you down */
    top: 100px;
}

/* Stepper */
.checkout-stepper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
    background: var(--white);
    padding: 20px 0;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.checkout-stepper::before {
    content: '';
    position: absolute;
    top: 35%;
    /* Fixed the line placement slightly higher for the circle */
    transform: translateY(-50%);
    left: 40px;
    right: 40px;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.step-icon {
    width: 40px;
    height: 40px;
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-muted);
    transition: var(--transition);
}

.step.active .step-icon,
.step.completed .step-icon {
    background: var(--primary-orange);
    border-color: var(--primary-orange);
    color: var(--white);
}

.step-label {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 700;
}

.step.active .step-label {
    color: var(--primary-orange);
}

/* Step Content */
.checkout-step-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 30px;
    border: 1px solid var(--border-color);
    display: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.checkout-step-content.active {
    display: block;
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-input {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: var(--font-family);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.form-input:focus {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

.error-msg {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

.form-input.error {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Delivery & Payment Options */
.delivery-option,
.payment-option {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    transition: var(--transition);
    background: var(--white);
}

.delivery-option:hover,
.payment-option:hover {
    border-color: var(--primary-orange);
    background: rgba(255, 107, 53, 0.02);
}

/* Advanced visual queue when checked */
.delivery-option:has(input:checked),
.payment-option:has(input:checked) {
    border-color: var(--primary-orange);
    background: rgba(255, 107, 53, 0.04);
}

.delivery-option input,
.payment-option input {
    margin-top: 5px;
    accent-color: var(--primary-orange);
    transform: scale(1.3);
    cursor: pointer;
}

.option-details h4 {
    color: var(--primary-blue);
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.option-details p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.payment-fields {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed var(--border-color);
    display: none;
}

.step-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.step-actions .btn {
    min-width: 140px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

/* Review Order Section */
.review-section {
    margin-bottom: 30px;
    background: var(--light-bg);
    padding: 25px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.review-section h4 {
    color: var(--primary-blue);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px dashed var(--border-color);
    font-size: 1.15rem;
}

.review-data {
    font-size: 1rem;
    color: var(--text-dark);
    line-height: 1.8;
}

.review-data p {
    margin-bottom: 8px;
}

.review-data strong {
    color: var(--primary-blue);
    margin-left: 5px;
}

[dir=\"ltr\"] .review-data strong {
    margin-left: 0;
    margin-right: 5px;
}

/* Responsive Checkout */
@media(max-width: 992px) {
    .checkout-layout {
        flex-direction: column;
    }

    .checkout-sidebar {
        width: 100%;
        position: static;
    }
}

@media(max-width: 768px) {
    .checkout-stepper {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
        padding: 25px;
    }

    .checkout-stepper::before {
        display: none;
        /* Hide connecting line on mobile */
    }

    .step {
        display: flex;
        align-items: center;
        gap: 15px;
        width: 100%;
        text-align: right;
    }

    [dir="ltr"] .step {
        text-align: left;
    }

    .step-icon {
        margin: 0;
        /* Remove auto margins */
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
}