/**
 * Luxury Theme - Checkout Page Styles
 */

.checkout-page {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Progress */
.checkout-progress {
    display: flex;
    justify-content: space-between;
    position: relative;
    max-width: 600px;
    margin: 0 auto 50px;
}

.progress-line {
    position: absolute;
    top: 17px;
    left: 0;
    right: 0;
    height: 2px;
    background: #eee;
    z-index: 1;
}

.step {
    position: relative;
    z-index: 2;
    text-align: center;
    background: #fff;
    padding: 0 15px;
}

.step-icon {
    width: 35px;
    height: 35px;
    background: #eee;
    color: #999;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-weight: 600;
    transition: 0.3s;
}

.step.active .step-icon {
    background: #000;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(0,0,0,0.1);
}

.step.completed .step-icon {
    background: #27ae60;
    color: #fff;
}

.step span {
    font-size: 0.85rem;
    font-weight: 500;
    color: #999;
}

.step.active span {
    color: #000;
    font-weight: 600;
}

.checkout-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
}

.checkout-section {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 35px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.section-heading {
    font-size: 1.25rem;
    margin-bottom: 30px;
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-heading i {
    color: #333;
}

/* Address Selection */
.address-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.address-card {
    position: relative;
    border: 2px solid #eee;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.address-card input[type="radio"] {
    display: none;
}

.address-card.selected {
    border-color: #000;
    background: #fafafa;
}

.address-card-content {
    padding: 20px;
}

.address-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.address-badge {
    background: #f0f0f0;
    color: #555;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.check-icon {
    color: #27ae60;
    font-size: 1.2rem;
    opacity: 0;
    transition: 0.2s;
}

.address-card.selected .check-icon {
    opacity: 1;
}

.address-name {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.address-card-body p {
    margin: 3px 0;
    font-size: 0.9rem;
    color: #666;
}

.address-phone {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #333;
}

/* New Address Form */
.new-address-form {
    padding: 25px;
    background: #fcfcfc;
    border-radius: 10px;
    border: 1px solid #f0f0f0;
    margin-top: 15px;
    animation: fadeIn 0.3s ease;
}

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

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

.form-group.floating {
    position: relative;
}

.form-group.floating input,
.form-group.floating textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: 0.3s;
    background: #fff;
}

.form-group.floating label {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
    transition: 0.3s;
}

.form-group.floating input:focus + label,
.form-group.floating input:not(:placeholder-shown) + label,
.form-group.floating textarea:focus + label,
.form-group.floating textarea:not(:placeholder-shown) + label {
    top: 0;
    left: 10px;
    font-size: 0.75rem;
    padding: 0 5px;
    background: #fff;
    color: #333;
}

/* Payment Tabs */
.payment-tabs {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-option {
    display: flex;
    align-items: center;
    padding: 18px;
    border: 1px solid #eee;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
}

.payment-option:hover {
    border-color: #ddd;
}

.payment-option.active {
    border-color: #000;
    background: #fafafa;
}

.payment-option input {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    margin-right: 15px;
    position: relative;
}

.payment-option.active .radio-custom {
    border-color: #000;
}

.payment-option.active .radio-custom::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    background: #000;
    border-radius: 50%;
}

.card-brands {
    margin-left: auto;
    font-size: 1.5rem;
    display: flex;
    gap: 10px;
    color: #999;
}

/* Sidebar Summary */
.checkout-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.order-summary-card {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 12px;
}

.summary-items {
    margin: 20px 0;
    max-height: 400px;
    overflow-y: auto;
}

.summary-item {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    align-items: stretch;
}

.summary-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Side Cart Item Overrides for Checkout Sidebar */
.order-summary-card .summary-items {
    max-height: 480px; /* Increased from 400px */
    overflow-y: auto;
    padding-right: 8px;
    margin-bottom: 20px;
}

/* More transparent scrollbar */
.order-summary-card .summary-items::-webkit-scrollbar {
    width: 4px;
}
.order-summary-card .summary-items::-webkit-scrollbar-track {
    background: transparent;
}
.order-summary-card .summary-items::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.05); /* Very subtle */
    border-radius: 10px;
}
.order-summary-card .summary-items:hover::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
}

.order-summary-card .side-cart-qty-control.read-only {
    display: flex;
    justify-content: flex-start;
    padding: 0;
    border: none;
    background: transparent;
}

.order-summary-card .side-cart-qty-control.read-only .qty-val {
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.order-summary-card .side-cart-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 15px;
    padding: 15px 0;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.order-summary-card .side-cart-item:last-child {
    border-bottom: none;
}

.order-summary-card .side-cart-item-img {
    width: 70px; /* Slightly larger image */
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0; /* Prevent image from shrinking */
}

.order-summary-card .side-cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Allow text to be contained */
}

.order-summary-card .side-cart-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.order-summary-card .side-cart-item-details-row {
    display: flex;
    flex-direction: row; /* Match sidecart */
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
    gap: 10px;
}

.order-summary-card .side-cart-detail-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.order-summary-card .side-cart-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.5px;
}

.order-summary-card .side-cart-price,
.order-summary-card .side-cart-line-total {
    font-size: 13px;
    font-weight: 600;
    color: #000;
}

/* Already defined above */

.order-summary-card .side-cart-item-remove-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.order-summary-card .side-cart-item-remove-btn:hover {
    color: #dc3545;
}

.order-summary-card .side-cart-item-details-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: auto;
}

.order-summary-card .side-cart-detail-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.order-summary-card .side-cart-label {
    font-size: 0.65rem;
    color: #888;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-summary-card .side-cart-price {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
}

.order-summary-card .side-cart-line-total {
    font-size: 0.85rem;
    font-weight: 700;
    color: #000;
}

.order-summary-card .side-cart-qty-control {
    display: flex;
    align-items: center;
    background: transparent;
    height: 24px;
}

.order-summary-card .side-cart-qty-control button {
    width: 20px;
    height: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    color: #666;
    transition: color 0.2s;
    line-height: 1;
    padding: 0;
}

.order-summary-card .side-cart-qty-control span.qty-val {
    min-width: 20px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 500;
    color: #333;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-totals {
    border-top: 1px solid #ddd;
    padding-top: 20px;
    margin-top: 20px;
}

.checkout-alert {
    background: #fff3f3;
    color: #dc3545;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ffeeba;
    margin-bottom: 20px;
}

.security-icon-large {
    font-size: 2rem;
    color: var(--text-muted, #999);
}

.security-icon-med {
    font-size: 1.5rem;
    color: var(--success, #28a745);
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: #555;
}

.total-row.discount {
    color: #27ae60;
}

.total-row.grand-total {
    font-size: 1.3rem;
    font-weight: 700;
    color: #000;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #eee;
}

.btn-checkout-action {
    display: block;
    width: 100%;
    padding: 18px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 30px;
}

.btn-checkout-action:hover {
    background: #333;
    transform: translateY(-2px);
}

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

.checkout-coupon-form {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.checkout-coupon-form input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 0.9rem;
}

.applied-coupon-item {
    background: #f0f7f3;
    padding: 8px 12px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #27ae60;
    margin-bottom: 5px;
}

.discount-info small {
    display: block;
    line-height: 1.2;
    font-size: 0.75rem;
}

/* Special Checkout Offer */

.checkout-special-offer {
    border: 1px solid #ffebea;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.05);
}

.offer-timer-header {
    background: #333;
    color: #fff;
    padding: 10px 20px;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.offer-content {
    padding: 25px;
}

.offer-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.offer-product {
    display: flex;
    gap: 20px;
    align-items: center;
    background: #fafafa;
    padding: 15px;
    border-radius: 10px;
}

.offer-product .product-img {
    width: 100px;
    height: 100px;
}

.offer-product .product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.product-name a {
    color: inherit;
    text-decoration: none;
    transition: 0.3s;
}

.product-name a:hover {
    color: #d32f2f;
}

.offer-badge {
    display: inline-block;
    background: #fff9c4;
    color: #827717;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.offer-pricing {
    display: flex;
    align-items: center;
    gap: 12px;
}

.offer-pricing .old-price {
    text-decoration: line-through;
    color: #545b62;
    font-size: 1rem;
}

.offer-pricing .new-price {
    color: #000;
    font-weight: 800;
    font-size: 1.25rem;
}

.offer-actions {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 15px;
}

.btn-decline {
    padding: 12px;
    font-weight: 600;
    border-color: #eee;
}

.btn-accept {
    padding: 12px;
    font-weight: 700;
    font-size: 1rem;
}

body .text-danger { color: #dc3545; }
body .text-muted { color: #888; }
body .ms-2 { margin-left: 0.5rem; }

@media (max-width: 900px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }
    .checkout-progress {
        display: none;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .address-selection {
        grid-template-columns: 1fr;
    }
}

.checkout-credits {
    font-size: 12px;
    color: #888;
    font-weight: 500;
}

.credits-link {
    color: #333;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.credits-link:hover {
    color: #e74c3c;
}

body .fa-heart.text-danger {
    color: #e74c3c;
}

.loyalty-points-earn {
    font-size: 13px;
    color: #444;
    padding: 12px;
    background: #fff9e6; /* Light warning/gold background */
    border-radius: 8px;
    border: 1px solid #ffeeba;
    display: inline-block;
    width: 100%;
}

.checkout-auth-banner {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    margin-bottom: 40px;
}

.banner-icon-wrapper {
    width: 50px;
    height: 50px;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #333;
}

.banner-content {
    flex: 1;
}

.banner-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: #000;
}

.banner-text {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0;
}

.btn-login-now {
    padding: 10px 25px;
    font-weight: 600;
    border-radius: 8px;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .checkout-auth-banner {
        flex-direction: column;
        text-align: center;
        padding: 25px;
    }
    .banner-actions {
        width: 100%;
    }
    .btn-login-now {
        width: 100%;
    }
}

/* Loyalty Info Tooltip */
.loyalty-info-tooltip {
    position: relative;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loyalty-info-tooltip i {
    font-size: 0.9rem;
    color: #4a90e2;
    transition: color 0.2s;
}

.loyalty-info-tooltip:hover i {
    color: #357abd;
}

.loyalty-info-tooltip .tooltip-text {
    visibility: hidden;
    width: 220px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 12px;
    position: absolute;
    z-index: 100;
    bottom: 140%;
    left: 50%;
    margin-left: -110px;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.5;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    pointer-events: none;
}

.loyalty-info-tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.loyalty-info-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Adjustments for flex layout in checkout banners */
body .d-flex.align-items-center {
    display: flex;
    align-items: center;
}

body .justify-content-center {
    justify-content: center;
}

@media (min-width: 768px) {
    body .justify-content-md-start {
        justify-content: flex-start;
    }
}

@media (max-width: 767px) {
    .loyalty-info-tooltip .tooltip-text {
        bottom: auto;
        top: 140%;
        left: 50%;
        margin-left: -110px;
    }
    .loyalty-info-tooltip .tooltip-text::after {
        top: auto;
        bottom: 100%;
        border-color: transparent transparent #333 transparent;
    }
}