/* CHECKOUT PAGE STYLES */

/* --- HEADER OVERRIDES (Match Cart Page) --- */
body.checkout-page .main-header {
    background-color: #ffffff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

body.checkout-page .brand-logo-text,
body.checkout-page .brand-logo-text a,
body.checkout-page .nav-link, 
body.checkout-page .cart-icon {
    color: #31262A !important; 
}

body.checkout-page .brand-logo-text {
    font-size: 2.5rem;
    padding-top: 10px;
}

body.checkout-page .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(49, 38, 42, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* --- PAGE LAYOUT --- */
body.checkout-page {
    background-color: #FFEAEA;
    padding-top: 40px;
}

.checkout-container {
    max-width: 1200px;
    padding-bottom: 80px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #31262A;
    text-decoration: none;
    font-family: "Montserrat", sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.back-link:hover {
    color: #E68A8A;
}

/* --- CARDS & FORMS --- */
.checkout-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
}

.checkout-section-title {
    font-family: "Playfair Display", serif;
    font-size: 1.5rem;
    color: #31262A;
    margin-bottom: 25px;
    text-align: center;
}

.form-label {
    font-family: "Montserrat", sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #31262A;
    margin-bottom: 8px;
}

.form-control {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 12px 15px;
    font-size: 0.9rem;
    color: #555;
    font-family: "Montserrat", sans-serif;
}

.form-control::placeholder {
    color: #ccc;
}

.form-control:focus {
    box-shadow: 0 0 0 3px rgba(230, 138, 138, 0.2);
    border-color: #E68A8A;
}

/* --- PAYMENT DETAILS --- */
.payment-selection {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.payment-option {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s;
}

.payment-option:has(input:checked) {
    border-color: #31262A;
    background-color: #fafafa;
}

.form-check-input:checked {
    background-color: #31262A;
    border-color: #31262A;
}

.btn-complete-purchase {
    background-color: #FFEAEA;
    color: #31262A;
    border: none;
    border-radius: 8px;
    padding: 15px;
    font-family: "Playfair Display", serif;
    font-weight: 600;
    font-size: 1.2rem;
    transition: all 0.3s;
    border: 1px solid #FFEAEA;
}

.btn-complete-purchase:hover {
    background-color: #E68A8A;
    color: white;
    border-color: #E68A8A;
}

.terms-text {
    font-size: 0.75rem;
    color: #888;
}

/* --- STICKY ORDER SUMMARY --- */

/* Key to Sticky:
   1. The Parent Column must not have overflow:hidden.
   2. top: value must account for the fixed header height (~90px usually).
*/
.sticky-wrapper {
    position: -webkit-sticky; /* Safari */
    position: sticky;
    top: 230px; /* Adjust based on header height */
    z-index: 5;
}

.order-summary-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.summary-title {
    font-family: "Playfair Display", serif;
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: #31262A;
}

.checkout-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.checkout-item-img {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 15px;
}

.checkout-item-info h5 {
    font-family: "Playfair Display", serif;
    font-size: 1rem;
    margin-bottom: 5px;
    color: #31262A;
}

.checkout-item-info p {
    font-size: 0.85rem;
    margin-bottom: 0;
    color: #777;
}

.checkout-item-price {
    margin-left: auto;
    font-family: "Montserrat", sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: #31262A;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-family: "Playfair Display", serif;
    color: #555;
    font-size: 1rem;
}

.summary-total {
    font-family: "Playfair Display", serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: #31262A;
}

/* Mobile Adjustments */
@media (max-width: 991px) {
    .sticky-wrapper {
        position: static; /* Disable sticky on mobile stack */
        margin-top: 30px;
    }
}