/**
 * Custom Cart Page Styles
 */

.bollypiano-cart-container,
.bollypiano-cart-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0;
    /* User requested full-width with no outer padding */
    padding: 0;
    box-sizing: border-box;
}

.bollypiano-cart-layout,
.bollypiano-cart-grid {
    display: grid;
    /* Make cart details narrower and sidebar wider */
    grid-template-columns: minmax(0, 1fr) 470px;
    gap: 2rem;
    align-items: start;
    width: 100%;
    margin: 0;
}

/* Cart Items Section */
.bollypiano-cart-items,
.bollypiano-cart-main {
    background: #FFFFFF;
    border-radius: 0.75rem;
    border: 1px solid #E7E2DA;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

/* When membership toggle is ON, tint the cart details container with a light secondary shade */
.bollypiano-cart-container.bollypiano-member-discount-on .bollypiano-cart-items,
.bollypiano-cart-container.bollypiano-member-discount-on .bollypiano-cart-main {
    background: rgba(62, 153, 6, 0.06); /* light secondary */
    border-color: var(--secondary);
}

/* When membership product is in cart: same cart box styling + show "50% member discount applied" only; no price slashing, no order summary changes */
.bollypiano-cart-container.bollypiano-membership-in-cart .bollypiano-cart-items,
.bollypiano-cart-container.bollypiano-membership-in-cart .bollypiano-cart-main {
    background: rgba(62, 153, 6, 0.06); /* light secondary */
    border-color: var(--secondary);
}

.bollypiano-cart-container.bollypiano-membership-in-cart .bollypiano-member-discount-note {
    display: flex;
    margin-top: 0.25rem;
    color: var(--primary);
    font-size: 0.8125rem;
    align-items: center;
    gap: 0.35rem;
}

.bollypiano-cart-form {
    width: 100%;
}

.bollypiano-cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #F5F5F5;
}

.bollypiano-cart-item:last-child {
    border-bottom: none;
}

.bollypiano-cart-list {
    width: 100%;
}

.bollypiano-cart-item-left {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bollypiano-cart-item-left .bollypiano-cart-item-remove {
    flex-shrink: 0;
}

.bollypiano-cart-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.bollypiano-cart-item-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.bollypiano-cart-item-content img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.bollypiano-cart-item-details {
    flex: 1;
}

.bollypiano-member-discount-note {
    display: none;
}

/* Show member discount UI when membership toggle is ON */
.bollypiano-membership-box.is-on ~ .bollypiano-cart-totals,
.bollypiano-membership-box.is-on {
    /* no-op selectors to keep specificity grouping safe */
}

.bollypiano-cart-container.bollypiano-member-discount-on .bollypiano-member-discount-note {
    display: flex;
    margin-top: 0.25rem;
    color: var(--primary);
    font-size: 0.8125rem;
    align-items: center;
    gap: 0.35rem;
}

/* Keep base rule hidden by default (do not override) */

/* Right-side price: show ONE price by default; show slashed+discounted only when toggle is ON */
.bollypiano-cart-price-discounted {
    display: none;
}

.bollypiano-cart-container.bollypiano-member-discount-on .bollypiano-cart-item-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.1;
    gap: 0.25rem;
}

.bollypiano-cart-container.bollypiano-member-discount-on .bollypiano-cart-price-regular {
    color: #666666;
    text-decoration: line-through;
    font-size: 0.875rem;
}

/* Remove strikethrough for membership products */
.bollypiano-cart-container.bollypiano-member-discount-on .bollypiano-membership-product .bollypiano-cart-price-regular,
.bollypiano-cart-container.bollypiano-member-discount-on .bollypiano-membership-product .bollypiano-cart-item-price .bollypiano-cart-price-regular,
.bollypiano-cart-container.bollypiano-member-discount-on .bollypiano-membership-product-price .bollypiano-cart-price-regular,
.bollypiano-cart-container.bollypiano-member-discount-on .bollypiano-cart-item.bollypiano-membership-product .bollypiano-cart-price-regular {
    text-decoration: none !important;
    color: inherit !important;
    font-size: inherit !important;
}

.bollypiano-cart-container.bollypiano-member-discount-on .bollypiano-cart-price-discounted {
    display: inline;
    color: var(--primary);
    font-weight: 700;
    font-size: 1rem;
}

/* Totals rows styling when discount is shown */
.bollypiano-order-summary tr.bollypiano-member-discount-row .amount {
    color: var(--primary);
    font-weight: 700;
}

.bollypiano-order-summary tr.bollypiano-member-save-row .amount {
    color: var(--secondary);
    font-weight: 700;
}

.bollypiano-cart-item-details a {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f1f1f;
    text-decoration: none;
    display: block;
    margin-bottom: 0.25rem;
}

.bollypiano-cart-item-details a:hover {
    color: var(--primary);
}

.bollypiano-cart-item-details .wc-item-meta {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #666666;
}

.bollypiano-cart-item-details .wc-item-meta p {
    margin: 0.25rem 0;
}

.bollypiano-cart-item-price {
    font-size: 1rem;
    font-weight: 600;
    color: #1f1f1f;
}

.bollypiano-remove-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #F5F5F5;
    color: #666666;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.bollypiano-remove-item--inline {
    background: transparent;
    width: auto;
    height: auto;
    border-radius: 0;
    box-shadow: none;
    color: #EF4444;
}

.bollypiano-remove-item--inline:hover {
    background: transparent;
    color: #EF4444;
    transform: none;
    text-decoration: none;
    opacity: 0.85;
}

.bollypiano-remove-item:hover {
    background: #EF4444;
    color: #FFFFFF;
    transform: scale(1.1);
}

.bollypiano-remove-item svg {
    width: 16px;
    height: 16px;
}

/* Cart Actions */
.bollypiano-cart-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid #E5E5E5;
    flex-wrap: wrap;
}

.bollypiano-cart-coupon-wrapper {
    margin: 0;
    width: auto;
    max-width: 400px;
}

.bollypiano-cart-coupon {
    display: block;
    margin: 0;
    padding: 0;
    border: none;
    width: 100%;
}

.bollypiano-coupon-messages {
    margin-top: 0.5rem;
    width: 100%;
    text-align: left;
}

.bollypiano-coupon-messages .woocommerce-error,
.bollypiano-coupon-messages .woocommerce-message,
.bollypiano-coupon-messages .woocommerce-info,
.bollypiano-coupon-messages .woocommerce-notice {
    font-size: 12px;
    padding: 0.5rem 0.75rem;
    margin: 0;
    border-radius: 4px;
    display: block;
    text-align: left;
}

.bollypiano-coupon-messages .woocommerce-error {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

p#coupon-error-notice {
    font-size: 0.7rem;
    margin-top: 8px;
}

.bollypiano-coupon-messages .woocommerce-message,
.bollypiano-coupon-messages .woocommerce-info {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.bollypiano-cart-coupon input.input-text {
    width: auto;
    min-width: 140px;
    max-width: 180px;
    border: 1px solid #E7E2DA;
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    font-size: 0.875rem;
    background: #FFFFFF;
}

.bollypiano-cart-coupon button.button {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Continue Shopping uses global .btn.btn-outline; only layout for icon+text */
.bollypiano-continue-shopping {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.bollypiano-continue-shopping svg {
    width: 18px;
    height: 18px;
}

/* Cart Sidebar */
.bollypiano-cart-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Membership Box */
.bollypiano-membership-box {
    border-radius: 0.75rem;
    border: 1px solid var(--primary);
    background: rgba(220, 129, 0, 0.06); /* light primary */
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
}

.bollypiano-membership-box.is-on {
    border-color: var(--secondary);
    background: rgba(62, 153, 6, 0.08); /* light secondary */
}

.bollypiano-membership-box.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* "You are Unlimited" box when membership product is in cart - same style as toggled box */
.bollypiano-membership-box-unlimited {
    border-color: var(--secondary);
    background: rgba(62, 153, 6, 0.08); /* light secondary */
}

.bollypiano-membership-badge {
    position: absolute;
    top: -12px;
    right: 1.5rem;
    background: var(--secondary);
    color: #FFFFFF;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bollypiano-membership-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f1f1f;
    margin: 0.5rem 0 0 0;
}

.bollypiano-membership-subtitle {
    font-size: 1rem;
    color: #1f1f1f;
    margin: 0 0 0.75rem 0;
}

.bollypiano-membership-intro {
    font-size: 0.9rem;
    color: #555;
    margin: 0 0 1rem 0;
    line-height: 1.4;
}

.bollypiano-membership-pricing {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #FFFFFF;
    border-radius: 0.75rem;
    border: 1px solid #E7E2DA;
}

.bollypiano-membership-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #666666;
}

.bollypiano-membership-row.highlight {
    color: #1f1f1f;
    font-weight: 600;
}

.bollypiano-member-price {
    color: var(--primary);
    font-size: 1.125rem;
    font-weight: 700;
}

.bollypiano-membership-row.savings {
    color: var(--secondary);
    font-weight: 600;
}

.bollypiano-savings {
    font-size: 1rem;
    font-weight: 700;
}

/* Membership Toggle */
.bollypiano-membership-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #FFFFFF;
    border-radius: 0.75rem;
    border: 1px solid #E7E2DA;
}

.bollypiano-toggle-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
}

.bollypiano-toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    flex-shrink: 0;
}

.bollypiano-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.bollypiano-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #CCCCCC;
    transition: 0.3s;
    border-radius: 24px;
}

.bollypiano-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.bollypiano-toggle-switch input:checked + .bollypiano-toggle-slider {
    background-color: var(--secondary);
}

.bollypiano-toggle-switch input:checked + .bollypiano-toggle-slider:before {
    transform: translateX(24px);
}

.bollypiano-toggle-label {
    font-size: 0.875rem;
    color: #1f1f1f;
}

/* Toggle off: show "Add Monthly Membership", hide "Monthly Membership added" */
.bollypiano-toggle-label-on {
    display: none;
}
.bollypiano-toggle-label-off {
    display: block;
}
/* Toggle on: show "Monthly Membership added", hide "Add Monthly Membership" */
.bollypiano-membership-box.is-on .bollypiano-toggle-label-on {
    display: block;
}
.bollypiano-membership-box.is-on .bollypiano-toggle-label-off {
    display: none;
}

.bollypiano-toggle-sub {
    font-size: 0.8125rem;
    color: #666666;
}

.bollypiano-toggle-price {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary);
    margin-left: auto;
    white-space: nowrap;
}

.bollypiano-membership-box.is-on .bollypiano-toggle-price {
    color: var(--secondary);
}

/* Membership Benefits */
.bollypiano-membership-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.bollypiano-membership-benefits li {
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: #666666;
    position: relative;
    padding-left: 1.5rem;
}

/* Checkmark on every benefit item - explicit display so it doesn't disappear (both boxes) */
.bollypiano-membership-box .bollypiano-membership-benefits li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0.5rem;
    display: inline-block !important;
    width: 1em;
    color: var(--secondary);
    font-weight: 700;
    font-size: 1em;
    line-height: 1.4;
}

.bollypiano-membership-footer {
    font-size: 0.75rem;
    color: #999999;
    text-align: center;
    margin: 0;
}

/* Cart Totals */
.bollypiano-cart-totals,
.bollypiano-order-summary {
    background: #FFFFFF;
    border-radius: 0.75rem;
    border: 1px solid #E7E2DA;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    position: relative; /* For badge positioning */
}

.bollypiano-cart-totals-wrapper {
    width: 100%;
    margin: 0;
}

/* Savings Badge on Order Summary */
.bollypiano-summary-savings-badge {
    position: absolute;
    top: -12px;
    right: 1.5rem;
    background: var(--secondary);
    color: #FFFFFF;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    z-index: 10;
}

.bollypiano-summary-savings-badge .bollypiano-savings-amount {
    font-weight: 700;
}

/* Custom order summary layout (no table) */
.bollypiano-summary-title {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 700;
    color: #1f1f1f;
}

.bollypiano-summary-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bollypiano-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.bollypiano-summary-label {
    color: #666666;
    font-size: 0.9375rem;
}

.bollypiano-summary-value {
    color: #1f1f1f;
    font-weight: 600;
    font-size: 0.9375rem;
}

.bollypiano-summary-label--accent {
    color: var(--primary);
}

.bollypiano-summary-row--discount .bollypiano-summary-value {
    color: var(--primary);
    font-weight: 700;
}

.bollypiano-summary-label--save {
    color: var(--secondary);
}

.bollypiano-summary-row--save .bollypiano-summary-value {
    color: var(--secondary);
    font-weight: 700;
}

.bollypiano-summary-divider {
    height: 1px;
    background: #E7E2DA;
    margin: 1rem 0;
}

.bollypiano-summary-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.bollypiano-summary-total-label {
    font-size: 1rem;
    font-weight: 700;
    color: #1f1f1f;
}

.bollypiano-summary-total-value {
    font-size: 1.125rem;
    font-weight: 800;
    color: #1f1f1f;
}

.bollypiano-summary-cta {
    margin-top: 1.25rem;
}

/* Make WooCommerce proceed button match our primary button */
.bollypiano-order-summary a.checkout-button,
.bollypiano-order-summary a.checkout-button.button,
.bollypiano-order-summary a.checkout-button.wc-forward {
    background-color: var(--primary) !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 0.875rem 1.25rem !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    width: 100% !important;
    display: block !important;
    text-align: center !important;
    box-shadow: 0 6px 14px rgba(220, 129, 0, 0.25);
}

.bollypiano-order-summary a.checkout-button:hover {
    background-color: #C57200 !important;
    color: #FFFFFF !important;
}

.bollypiano-cart-totals .shop_table,
.bollypiano-order-summary .shop_table,
.bollypiano-cart-totals-wrapper .shop_table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.5rem 0;
}

.bollypiano-cart-totals .shop_table th,
.bollypiano-cart-totals .shop_table td,
.bollypiano-order-summary .shop_table th,
.bollypiano-order-summary .shop_table td,
.bollypiano-cart-totals-wrapper .shop_table th,
.bollypiano-cart-totals-wrapper .shop_table td {
    padding: 0.75rem 0;
    text-align: left;
    border-bottom: 1px solid #F5F5F5;
}

.bollypiano-cart-totals .shop_table th,
.bollypiano-order-summary .shop_table th,
.bollypiano-cart-totals-wrapper .shop_table th {
    font-size: 0.875rem;
    font-weight: 600;
    color: #666666;
}

.bollypiano-cart-totals .shop_table td,
.bollypiano-order-summary .shop_table td,
.bollypiano-cart-totals-wrapper .shop_table td {
    font-size: 1rem;
    font-weight: 600;
    color: #1f1f1f;
    text-align: right;
}

.bollypiano-cart-totals .shop_table .order-total th,
.bollypiano-cart-totals .shop_table .order-total td,
.bollypiano-order-summary .shop_table .order-total th,
.bollypiano-order-summary .shop_table .order-total td,
.bollypiano-cart-totals-wrapper .shop_table .order-total th,
.bollypiano-cart-totals-wrapper .shop_table .order-total td {
    border-top: 2px solid #E5E5E5;
    border-bottom: none;
    padding-top: 1rem;
    font-size: 1.125rem;
}

.bollypiano-cart-totals .checkout-button,
.bollypiano-order-summary .checkout-button,
.bollypiano-cart-totals-wrapper .checkout-button {
    width: 100%;
    margin: 1rem 0 0 0;
}

/* Empty Cart */
.bollypiano-empty-cart {
    text-align: center;
    padding: 3rem 1.25rem;
}

/* Ensure all WooCommerce elements have no margin */
.bollypiano-cart-container *,
.bollypiano-cart-wrapper * {
    box-sizing: border-box;
}

.bollypiano-cart-container .woocommerce,
.bollypiano-cart-wrapper .woocommerce {
    margin: 0;
    width: 100%;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .bollypiano-cart-layout,
    .bollypiano-cart-grid {
        grid-template-columns: 1fr;
    }
    
    .bollypiano-cart-sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .bollypiano-cart-container {
        padding: 1rem;
    }
    
    .bollypiano-cart-items,
    .bollypiano-membership-box,
    .bollypiano-cart-totals {
        padding: 1rem;
    }
    
    .bollypiano-cart-table {
        font-size: 0.875rem;
    }
    
    .bollypiano-cart-table th {
        font-size: 0.75rem;
        padding: 0.75rem 0;
    }
    
    .bollypiano-cart-item td {
        padding: 1rem 0;
    }
    
    .bollypiano-cart-item-content img {
        width: 60px;
        height: 60px;
    }
    
    .bollypiano-cart-item-details a {
        font-size: 0.875rem;
    }
    
    .bollypiano-cart-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bollypiano-continue-shopping {
        width: 100%;
        justify-content: center;
    }
    
    .bollypiano-membership-title {
        font-size: 1.25rem;
    }
    
    .bollypiano-cart-table th.product-image,
    .bollypiano-cart-table th.product-price,
    .bollypiano-cart-table th.product-remove {
        width: auto;
    }
}

