/**
 * Cart Page CSS
 * This file contains the CSS styles for the cart page
 */

/* ========================================
   Cart Main Layout
   ======================================== */
.cart-main {
    padding: 30px 60px;
    background-color: #FFF;
}

@media (max-width: 768px) {
    .cart-main {
        padding: 30px 20px;
    }
}

.cart-top-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .cart-top-bar {
        margin-bottom: 26px;
    }
}

.cart-top-bar-container {
    display: flex;
    align-items: center;
    gap: 14px;
}

@media (max-width: 768px) {
    .cart-top-bar-container {
        gap: 10px;
    }
}

.cart-top-bar-link {
    font-size: 12px;
    color: #526572;
    line-height: 1.5;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cart-top-bar-link:hover {
    color: #082E42;
}

.cart-top-bar-divider {
    font-size: 12px;
    color: #526572;
    line-height: 1.5;
}

.cart-top-bar-zip {
    font-size: 12px;
    color: #526572;
    line-height: 1.5;
}

.cart-container {
    display: grid;
    grid-template-columns: 6fr 4fr;
    gap: 48px;
    align-items: start;
}

@media (max-width: 768px) {
    .cart-container {
        grid-template-columns: 1fr;
        gap: 42px;
    }
}

/* ========================================
   Left Section - Cart Items
   ======================================== */
.cart-items-section {
    width: 100%;
}

.cart-header {
    margin-bottom: 36px;
}

@media (max-width: 768px) {
    .cart-header {
        margin-bottom: 24px;
    }
}

.cart-title {
    font-size: 30px;
    font-weight: 700;
    color: #082E42;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 12px;
}

.cart-count {
    font-size: 16px;
    font-weight: 400;
    color: #526572;
    line-height: 1.5;
}

.cart-signin-prompt {
    font-size: 14px;
    color: #082E42;
    line-height: 1.5;
}

.cart-empty-message {
    margin-top: 8px;
}

.cart-empty-message p {
    font-size: 16px;
    color: #082E42;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 8px;
}

.cart-group-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: #F3F4F4;
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .cart-group-card {
        padding: 12px;
    }
}

.cart-group-card:last-child {
    margin-bottom: 0;
}

.cart-items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shipping-method {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: #082E42;
    line-height: 1.5;
}

.shipping-method .selected-store-name {
    font-size: 12px;
    font-weight: 400;
    color: #526572;
    line-height: 1.4;
    margin-left: 2px;
}

.shipping-method .selected-store-name::before {
    content: '· ';
}

.item-count {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    color: #082E42;
}

/* Save for Later */
.saved-later-header {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 12px;
}

.saved-later-title {
    font-size: 30px;
    color: #082E42;
    font-weight: 700;
    line-height: 1.5;
}

.saved-later-count {
    font-size: 16px;
    font-weight: 400;
    color: #526572;
    line-height: 1.5;
}

.saved-later-card {
    background-color: #F8F8F8;
}

.saved-later-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 24px;
    row-gap: 16px;
}

.saved-later-item + .saved-later-item {
    border-top: 1px solid #DCE3E5;
    padding-top: 16px;
}

.saved-later-item-info {
    min-width: 0;
}

.move-to-cart-btn {
    align-self: flex-start;
    padding: 8px 16px;
    background-color: #1C1C1C;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #FFFFFF;
    cursor: pointer;
    transition: background-color 0.2s;
}

.move-to-cart-btn:hover {
    background-color: #000000;
}

@media (max-width: 768px) {
    .saved-later-item {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .item-count {
        gap: 8px;
    }
}

.choose-store-link {
    text-decoration: underline;
}

.choose-store-link:hover {
    color: #1C1C1C;
}

/* Cart Item Content */
.cart-items-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 24px;
    row-gap: 16px;
    background-color: #fff;
    border-radius: 6px;
    padding: 20px;
}

@media (max-width: 768px) {
    .cart-items-content {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 14px;
    }
}

.item-image {
    width: 100%;
    background-color: #F6F6F5;
}

.item-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Item Details */
.item-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 768px) {
    .item-details {
        gap: 18px;
    }
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (max-width: 768px) {
    .item-info {
        flex-direction: row;
    }
}

.item-name {
    font-size: 18px;
    font-weight: 700;
    color: #082E42;
    font-weight: 700;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .item-name {
        font-size: 16px;
    }
}

.item-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.item-price {
    font-size: 16px;
    font-weight: 700;
    color: #082E42;
    line-height: 1.5;
}

/* Item Options */
.item-options {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    padding-top: 16px;
    border-top: 1px solid #DCE3E5;
}

@media (max-width: 768px) {
    .item-options {
        gap: 20px;
    }
}

.item-options-left {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.item-options-right {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.item-specs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.spec-item {
    font-size: 14px;
    color: #526572;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .spec-item {
        font-size: 12px;
    }
}

/* Quantity Selector */
.quantity-selector {
    display: inline-flex;
    align-items: center;
    border: 1px solid #B9C7CD;
    border-radius: 4px;
    overflow: hidden;
    width: fit-content;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    background-color: #fff;
    cursor: pointer;
    font-size: 14px;
    color: #082E42;
    line-height: 1.5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.qty-btn:disabled {
    color: #B0BEC5;
    cursor: not-allowed;
    background-color: #F4F6F6;
}

.qty-btn:disabled:hover {
    background-color: #F4F6F6;
}

.qty-btn:hover {
    background-color: #F4F4F4;
}

.qty-input {
    width: 40px;
    height: 36px;
    border: none;
    border-left: 1px solid #B9C7CD;
    border-right: 1px solid #B9C7CD;
    text-align: center;
    font-size: 14px;
    color: #526572;
    line-height: 1.5;
}

/* Shipping Options */
.shipping-options {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.shipping-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #082E42;
    line-height: 1.5;
}

.shipping-option input[type="radio"] {
    width: 17px;
    height: 17px;
    accent-color: #97740B;
}

.save-for-later {
    padding: 8px 0;
    font-size: 14px;
    color: #526572;
    line-height: 1.5;
    text-decoration: underline;
    white-space: nowrap;
}

.save-for-later:hover {
    color: #1C1C1C;
}

.low-stock-badge {
    display: block;
    font-size: 12px;
    color: #82620B;
    line-height: 1.5;
}

.cart-items-content .low-stock-badge,
.saved-later-item .low-stock-badge {
    grid-column: 1 / -1;
}

/* Continue Shopping */
.continue-shopping {
    display: inline-block;
    font-size: 14px;
    color: #082E42;
    line-height: 1.5;
    text-decoration: none;
}

.continue-shopping:hover {
    text-decoration: underline;
}

/* ========================================
   Right Section - Order Summary
   ======================================== */
.order-summary-section {
    position: sticky;
    top: 20px;
}

@media (max-width: 768px) {
    .order-summary-section {
        position: static;
    }
}

.summary-title {
    font-size: 26px;
    font-weight: 700;
    color: #082E42;
    line-height: 1.5;
    margin-bottom: 28px;
}

.summary-details {
    margin-bottom: 24px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 0;
    border-bottom: 1px solid #DCE3E5;
}

.summary-label {
    font-size: 16px;
    color: #082E42;
    line-height: 1.5;
}

.summary-label-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shipping-note {
    font-size: 14px;
    color: #526572;
    line-height: 1.5;
}

/* Estimated Fees：按配送方式逐行展示 */
.summary-fees {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.fees-title {
    font-weight: 700;
}

.summary-fees-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-fee-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #526572;
    line-height: 1.5;
}

.summary-fee-value {
    color: #082E42;
    white-space: nowrap;
}

.summary-value {
    font-size: 16px;
    color: #082E42;
    line-height: 1.5;
    white-space: nowrap;
}

.summary-total {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 20px;
}

.summary-total-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.summary-total .summary-label {
    font-size: 22px;
    color: #082E42;
    line-height: 1.5;
}

.summary-total .summary-value {
    font-size: 22px;
    color: #082E42;
    font-weight: 700;
    line-height: 1.5;
}

.shipping-estimate {
    display: block;
    font-size: 12px;
    color: #526572;
    line-height: 1.6;
}

/* Checkout Button */
.checkout-btn {
    width: 100%;
    padding: 18px 20px;
    background-color: #927000;
    color: #FFF;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.2s;
    margin-bottom: 28px;
}

.checkout-btn:hover {
    background-color: rgb(179, 143, 1);
}

.icon-arrow {
    font-size: 16px;
}

/* Promo Code Section */
.promo-code-section {
    margin-bottom: 25px;
}

.promo-title {
    font-size: 14px;
    color: #082E42;
    line-height: 1.5;
    margin-bottom: 12px;
}

.promo-input-group {
    display: flex;
    gap: 10px;
}

.promo-input {
    flex: 1;
    padding: 14px;
    border: 1px solid #B9C7CD;
    border-radius: 4px;
    background-color: #FFF;
    font-size: 14px;
    color: #082E42;
    outline: none;
    transition: border-color 0.2s;
}

.promo-input:focus {
    border-color: #1C1C1C;
}

.promo-input::placeholder {
    color: #757575;
}

.promo-btn {
    padding: 12px 18px;
    background-color: #fff;
    border: 1px solid #082E42;
    border-radius: 4px;
    font-size: 16px;
    color: #082E42;
    line-height: 1.5;
    cursor: pointer;
    transition: all 0.2s;
}

.promo-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.promo-msg {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: #16a34a;
    min-height: 0;
}

.promo-msg.is-error {
    color: #dc2626;
}

.promo-discount-value {
    color: #16a34a;
}

.promo-btn:hover {
    background-color: #F4F4F4;
    border-color: #1C1C1C;
}

/* Payment Methods */
.cart-payment-methods {
    padding-bottom: 28px;
    border-bottom: 1px solid #DCE3E5;
}

.payment-title {
    font-size: 14px;
    font-weight: 700;
    color: #082E42;
    line-height: 1.5;
    margin-bottom: 12px;
}

.payment-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 10px;
}

.payment-icon-item {
    height: 31px;
    width: 49px;
    padding: 3px;
    border-radius: 3px;
    border: 1px solid #E1E5E7;
    background: #FFF;
}

.payment-icons img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.availability-note {
    font-size: 12px;
    color: #526572;
    line-height: 1.5;
}

/* Helpful Links */
.helpful-links {
    margin-top: 22px;
}

.links-title {
    font-size: 14px;
    font-weight: 700;
    color: #082E42;
    line-height: 1.5;
    margin-bottom: 20px;
}

.link-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-size: 14px;
    color: #082E42;
    line-height: 1.5;
    gap: 8px;
    text-decoration: none;
    transition: color 0.2s;
}

.link-item:hover {
    text-decoration: underline;
}

.icon-external {
    font-size: 14px;
    color: #082E42;
    line-height: 1.5;
}

/*========================================
   Complete Your Ride Section
   ======================================== */

.complete-ride-section {
    background-color: #FFFFFF;
    margin-top: 60px;
}

@media (max-width: 768px) {
    .complete-ride-section {
        margin-top: 30px;
    }
}

.complete-ride-container {
    overflow-wrap: break-word;
}

.complete-ride-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 28px;
}

@media (max-width: 768px) {
    .complete-ride-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
}

.complete-ride-header-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.complete-ride-title {
    font-size: 30px;
    font-weight: 700;
    color: #082E42;
    line-height: 1.5;
    letter-spacing: -0.75px;
}

@media (max-width: 768px) {
    .complete-ride-title {
        font-size: 28px;
        letter-spacing: -0.675px;
    }
}

.complete-ride-subtitle {
    font-size: 14px;
    color: #526572;
    line-height: 1.5;
}

.complete-ride-shop-link {
    font-size: 14px;
    color: #082E42;
    line-height: 1.5;
    text-decoration: none;
    white-space: nowrap;
}

.complete-ride-shop-link:hover {
    text-decoration: underline;
}

.complete-ride-products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

@media (max-width: 768px) {
    .complete-ride-products {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 28px;
        column-gap: 14px;
    }
}

.complete-ride-card {
    overflow: hidden;
    transition: all 0.2s ease;
}

.complete-ride-card-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #F4F4F4;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.complete-ride-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.complete-ride-card-info {
    padding-top: 17px;
}

.complete-ride-card-name {
    font-size: 18px;
    color: #082E42;
    margin-bottom: 9px;
    font-weight: 700;
    line-height: 1.5;
}

.complete-ride-card-price {
    font-size: 14px;
    color: #082E42;
    line-height: 1.5;
    margin-bottom: 14px;
}

.complete-ride-promotion-price {
    color: #E53935;
}

.complete-ride-currency {
    font-size: 12px;
    color: #082E42;
    line-height: 1.65;
}

.complete-ride-view-more-link {
    display: inline-block;
    font-size: 12px;
    color: #082E42;
    line-height: 1.5;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.2s ease;
}

/* ========================================
   Remove Item Confirmation Modal
   ======================================== */
.remove-item-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.remove-item-modal-content {
    padding: 36px 40px;
    max-width: 500px;
    border-radius: 12px;
    background: #FFF;
    box-shadow: 0 20px 60px 0 rgba(4, 31, 52, 0.20);
}

@media (max-width: 768px) {
    .remove-item-modal-content {
        padding: 30px 24px;
        width: 100%;
    }
}

.remove-item-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #082E42;
    line-height: 1.3;
    letter-spacing: -0.3px;
    margin-bottom: 14px;
}

@media (max-width: 768px) {
    .remove-item-modal-title {
        font-size: 22px;
    }
}

.remove-item-modal-message {
    font-size: 16px;
    color: #425766;
    line-height: 1.65;
    margin-bottom: 26px;
}

@media (max-width: 768px) {
    .remove-item-modal-message {
        font-size: 14px;
    }
}

.remove-item-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .remove-item-modal-actions {
        flex-direction: column;
    }
}

.remove-item-modal-btn {
    padding: 12px 22px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    transition: all 0.2s;
}

.remove-item-modal-btn.cancel {
    border: 1px solid #082E42;
    background: #fff;
    color: #082E42
}

.remove-item-modal-btn.cancel:hover {
    background: #F4F4F4;
}

.remove-item-modal-btn.confirm {
    border: 1px solid #082E42;
    background: #082E42;
    color: #fff;
}

.remove-item-modal-btn.confirm:hover {
    background: #0d4a6b;
}