/* ============================================================
   Shopping Bag Page — custom layout (no Woo default styles)
   ============================================================ */
.bag-page {
    padding-top: 40px;
    padding-bottom: 100px;
}

.bag-page .page-title {
    display: none;
}

.bag-titlebar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
}

.bag-title {
    font-size: 34px;
    line-height: 1.15;
    font-weight: 700;
    color: #1E2426;
    margin: 0 0 8px;
}

.bag-subtitle {
    font-size: 14px;
    color: #777;
    margin: 0;
}

.bag-title-link {
    font-size: 14px;
    color: #1E2426;
    text-decoration: underline;
    white-space: nowrap;
}

/* ---------- Empty state ---------- */

.bag-empty {
    text-align: center;
    padding: 80px 0;
}

.bag-empty-icon {
    width: 90px;
    height: 90px;
    margin: 0 auto 24px;
    color: #ccc;
}

.bag-empty-icon svg {
    width: 100%;
    height: 100%;
}

.bag-empty h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.bag-empty p {
    font-size: 15px;
    color: #888;
    margin-bottom: 28px;
}

/* ---------- Layout ---------- */

.bag-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 48px;
    align-items: start;
}

@media (max-width: 991px) {
    .bag-layout {
        grid-template-columns: 1fr;
    }
}

/* ---------- Items ---------- */

.bag-item {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 20px;
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
    transition: opacity 0.15s ease;
}

.bag-status {
    display: none;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.bag-status.error,
.bag-status.success {
    display: block;
}

.bag-status.error {
    color: #b42318;
    background: #fff1f0;
    border: 1px solid #ffd2cc;
}

.bag-status.success {
    color: #18794e;
    background: #eefbf5;
    border: 1px solid #bcebd6;
}

.bag-item.is-updating {
    opacity: 0.58;
}

.bag-item-media {
    aspect-ratio: 3 / 4;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f5;
}

.bag-item-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bag-item-detail {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bag-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.bag-item-name {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.45;
    margin-bottom: 6px;
}

.bag-item-name a {
    color: inherit;
    text-decoration: none;
}

.bag-item-name a:hover {
    text-decoration: underline;
}

.bag-item-variant {
    font-size: 13px;
    color: #888;
}

.bag-item-variant dl,
.bag-item-variant dt,
.bag-item-variant dd {
    display: inline;
    margin: 0;
    padding: 0;
}

.bag-item-variant dt {
    font-weight: 500;
}

.bag-item-variant dd::after {
    content: ' · ';
}

.bag-item-variant dd:last-child::after {
    content: '';
}

.bag-item-remove {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
}

.bag-item-remove:hover {
    color: #1E2426;
}

.bag-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
}

.bag-item-price {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bag-item-price .current {
    font-size: 16px;
    font-weight: 600;
    color: #d73a49;
}

.bag-item-price .original {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
}

/* qty control reuses .qty-control/.qty-btn/.qty-input from main.css */

.qty-btn:disabled,
.qty-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.bag-continue {
    margin-top: 8px;
}

.bag-continue a {
    font-size: 14px;
    color: #1E2426;
    text-decoration: underline;
}

/* ---------- Sidebar / summary ---------- */

.bag-summary {
    background: #fafafa;
    border-radius: 16px;
    padding: 28px;
    position: sticky;
    top: 90px;
    transition: opacity 0.15s ease;
}

.bag-summary.is-updating {
    opacity: 0.78;
}

.bag-summary-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 6px;
}

.bag-summary-note {
    font-size: 13px;
    line-height: 1.5;
    color: #777;
    margin: 0 0 20px;
}

.bag-rows {
    border-top: 1px solid #eee;
    padding-top: 16px;
    margin-top: 16px;
}

.bag-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    font-size: 14px;
    color: #555;
}

.bag-row-discount span:last-child {
    color: #3cc99a;
}

.bag-row-total {
    font-size: 17px;
    font-weight: 700;
    color: #1E2426;
    border-top: 1px solid #eee;
    margin-top: 8px;
    padding-top: 14px;
}

.bag-checkout-btn {
    margin-top: 20px;
    text-align: center;
}

.bag-payment-icons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.bag-payment-icons span {
    font-size: 11px;
    color: #666;
    background: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #eee;
}

/* ---------- Promo ---------- */

.bag-promo-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    padding: 0;
    font-size: 14px;
    color: #1E2426;
    cursor: pointer;
}

.bag-promo-icon {
    width: 12px;
    height: 12px;
    position: relative;
}

.bag-promo-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid #1E2426;
    border-bottom: 1.5px solid #1E2426;
    transform: translate(-50%, -70%) rotate(45deg);
    transition: transform 0.25s ease;
}

.bag-promo.open .bag-promo-icon::before {
    transform: translate(-50%, -30%) rotate(-135deg);
}

.bag-promo-form {
    display: none;
    gap: 8px;
    margin-top: 12px;
}

.bag-promo.open .bag-promo-form {
    display: flex;
}

.bag-promo-form input {
    flex: 1;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}

.bag-promo-form button {
    height: 42px;
    padding: 0 20px;
    border: none;
    border-radius: 8px;
    background: #1E2426;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.bag-promo-msg {
    font-size: 13px;
    margin-top: 8px;
    min-height: 0;
}

.bag-promo-msg.error {
    color: #d73a49;
}

.bag-promo-msg.success {
    color: #3cc99a;
}

.bag-coupons {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
}

.bag-coupons li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border: 1px dashed #ddd;
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 8px;
    font-size: 13px;
}

.bag-coupon-code {
    font-weight: 600;
    text-transform: uppercase;
}

.bag-coupon-remove {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

@media (max-width: 576px) {
    .bag-titlebar {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 24px;
    }

    .bag-title {
        font-size: 26px;
    }

    .bag-item {
        grid-template-columns: 90px 1fr;
        gap: 14px;
    }

    .bag-page .page-title {
        font-size: 24px;
    }
}
