.wcc-cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
}

.wcc-cart-main,
.wcc-cart-sidebar,
.wcc-cart-items,
.wcc-recommendations {
    min-width: 0;
    max-width: 100%;
}

.wcc-cart-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 8px;
}

.wcc-cart-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.wcc-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.wcc-item-check input[type="checkbox"],
.wcc-cart-actions input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    border: 1px solid var(--wcc-border);
    background: #fff;
    position: relative;
}

.wcc-item-check input[type="checkbox"]:checked,
.wcc-cart-actions input[type="checkbox"]:checked {
    background: var(--wcc-primary);
    border-color: var(--wcc-primary);
}

.wcc-item-check input[type="checkbox"]:checked::after,
.wcc-cart-actions input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.wcc-cart-item {
    display: grid;
    grid-template-columns: auto 88px minmax(0, 1fr) minmax(120px, auto) auto;
    gap: 16px 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--wcc-border);
    align-items: start;
}

.wcc-item-check {
    display: flex;
    align-items: flex-start;
    padding-top: 28px;
}

.wcc-item-image img {
    width: 88px;
    height: 88px;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

.wcc-item-body {
    min-width: 0;
}

.wcc-item-sku { font-size: 13px; color: var(--wcc-muted); }
.wcc-item-name { font-size: 16px; margin: 4px 0; font-weight: 600; line-height: 1.35; }
.wcc-item-name a { color: inherit; text-decoration: none; }
.wcc-item-availability { font-size: 13px; color: var(--wcc-accent); margin-top: 4px; }

.wcc-item-pricing {
    text-align: right;
    padding-top: 4px;
    white-space: nowrap;
}

.wcc-item-price-old-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 4px;
}

.wcc-price-current { font-size: 18px; font-weight: 700; line-height: 1.2; }
.wcc-price-old { font-size: 14px; color: var(--wcc-muted); text-decoration: line-through; }

.wcc-badge-discount {
    background: #e8f5e9;
    color: var(--wcc-accent);
    margin-bottom: 0;
    white-space: nowrap;
}

.wcc-item-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 2px;
}

.wcc-qty {
    display: flex;
    align-items: center;
    border: 1px solid var(--wcc-border);
    border-radius: 24px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.wcc-qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.wcc-qty-input {
    width: 40px;
    text-align: center;
    border: none;
    font-size: 16px;
    -moz-appearance: textfield;
    appearance: textfield;
}

.wcc-qty-input::-webkit-outer-spin-button,
.wcc-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wcc-item-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.wcc-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--wcc-muted);
    border-radius: 50%;
}

.wcc-icon-btn:hover {
    background: #f5f5f5;
    color: var(--wcc-text);
}

.wcc-summary-stats { font-size: 14px; color: var(--wcc-muted); margin-bottom: 16px; }
.wcc-summary-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 15px; }
.wcc-summary-savings .wcc-accent { font-weight: 600; }
.wcc-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 22px;
    font-weight: 700;
    margin: 16px 0;
    padding-top: 16px;
    border-top: 1px solid var(--wcc-border);
}

.wcc-notice {
    margin: 0 0 8px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
}

.wcc-notice:last-child {
    margin-bottom: 0;
}

.wcc-notice--error {
    background: #fde8e8;
    color: #b91c1c;
}

.wcc-notice--success {
    background: #e8f5e9;
    color: #2e7d32;
}

.wcc-notice--info {
    background: #e3f2fd;
    color: #1565c0;
}

.wcc-notices:empty,
.wcc-coupon-notices:empty {
    display: none;
}

.wcc-coupon-notices {
    margin-bottom: 16px;
}

.wcc-coupon-form {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.wcc-coupon-form button[type="submit"] {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 108px;
    flex-shrink: 0;
}

.wcc-coupon-form button[type="submit"] .wcc-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.12);
    border-top-color: var(--wcc-primary);
    border-radius: 50%;
    animation: wcc-spin 0.7s linear infinite;
}

.wcc-coupon-form button[type="submit"].wcc-loading {
    opacity: 0.85;
    pointer-events: none;
}

.wcc-coupon-form button[type="submit"].wcc-loading .wcc-spinner {
    display: block;
}

.wcc-coupon-form button[type="submit"].wcc-loading .wcc-coupon-submit-label {
    opacity: 0.65;
}

.wcc-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 0, 0, 0.12);
    border-top-color: var(--wcc-primary);
    border-radius: 50%;
    animation: wcc-spin 0.7s linear infinite;
    flex-shrink: 0;
}

.wcc-qty-spinner {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    margin: -9px 0 0 -9px;
    z-index: 1;
    background: rgba(255, 255, 255, 0.85);
}

.wcc-qty.wcc-loading {
    pointer-events: none;
}

.wcc-qty.wcc-loading .wcc-qty-spinner {
    display: block;
}

.wcc-qty.wcc-loading .wcc-qty-btn,
.wcc-qty.wcc-loading .wcc-qty-input {
    opacity: 0.3;
}

.wcc-coupon-form input {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    border: 1px solid var(--wcc-border);
    border-radius: var(--wcc-radius-sm);
    font-size: 15px;
}

.wcc-applied-coupons {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}

.wcc-applied-coupon {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0 0;
    margin-top: 12px;
    border-top: 1px solid var(--wcc-border);
}

.wcc-applied-coupon__body {
    flex: 1;
    min-width: 0;
}

.wcc-applied-coupon__code {
    display: block;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--wcc-text);
}

.wcc-applied-coupon__desc {
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--wcc-muted);
}

.wcc-remove-coupon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--wcc-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.wcc-remove-coupon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.wcc-remove-coupon:hover {
    background: #f0f0f0;
    color: var(--wcc-text);
}

.wcc-recommendations { margin-top: 32px; }
.wcc-recommendations h2 { font-size: 20px; margin-bottom: 16px; }
.wcc-recommendations-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 100%;
}

.wcc-recommendations-list--loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
}

.wcc-recommendations-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--wcc-muted);
    font-size: 14px;
    line-height: 1.4;
}

.wcc-rec-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--wcc-border);
    border-radius: var(--wcc-radius-sm);
    padding: 12px;
}

.wcc-rec-card img {
    width: 100%;
    height: 100px;
    object-fit: contain;
    display: block;
}

.wcc-rec-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    margin: 8px 0 0;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.wcc-rec-title a {
    color: inherit;
    text-decoration: none;
}

.wcc-rec-title a:hover {
    color: var(--wcc-primary);
}

.wcc-rec-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
}

.wcc-rec-card .wcc-rec-price {
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

.wcc-rec-add {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--wcc-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.wcc-rec-add svg {
    width: 18px;
    height: 18px;
    display: block;
}

#wcc-go-checkout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#wcc-go-checkout .wcc-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wcc-spin 0.7s linear infinite;
    flex-shrink: 0;
}

#wcc-go-checkout.wcc-loading {
    opacity: 0.92;
    pointer-events: none;
}

#wcc-go-checkout.wcc-loading .wcc-spinner {
    display: block;
}

.wcc-rec-add.wcc-loading {
    opacity: 0.7;
    pointer-events: none;
}

@keyframes wcc-spin {
    to { transform: rotate(360deg); }
}

.wcc-empty-cart { text-align: center; padding: 48px 0; }

@media (max-width: 900px) {
    .wcc-cart-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .wcc-cart-page .wcc-cart-layout {
        gap: 0;
    }

    .wcc-cart-sidebar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 100;
        order: unset;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0 12px calc(12px + env(safe-area-inset-bottom, 0px));
        background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 18%);
        pointer-events: none;
    }

    .wcc-cart-sidebar .wcc-cart-summary {
        pointer-events: auto;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
        margin: 0;
    }
    
    .wcc-cart-summary .wcc-summary-row {
        margin-bottom: 8px;
        font-size: 14px;
    }

    .wcc-cart-summary .wcc-summary-meta {
        color: var(--wcc-muted);
    }

    .wcc-cart-summary .wcc-summary-savings-accordion {
        margin-bottom: 8px;
    }

    .wcc-cart-summary .wcc-summary-total {
        margin: 0 0 10px;
        padding-top: 0;
        border-top: none;
        font-size: 20px;
    }

    .wcc-cart-summary .wcc-coupon-form {
        margin-bottom: 8px;
    }

    .wcc-cart-summary .wcc-coupon-form input {
        padding: 10px 12px;
        font-size: 14px;
    }

    .wcc-cart-summary .wcc-applied-coupons {
        margin-bottom: 8px;
    }

    .wcc-cart-summary .wcc-applied-coupon {
        padding: 8px 0 0;
        margin-top: 8px;
    }

    .wcc-cart-summary #wcc-go-checkout {
        margin-top: 0;
        min-height: 48px;
    }

    .wcc-cart-item {
        grid-template-columns: auto 64px 1fr;
        grid-template-areas:
            "check image body"
            "check image pricing"
            ". . controls";
        gap: 12px 16px;
    }
    .wcc-item-check {
        grid-area: check;
        padding-top: 24px;
    }
    .wcc-item-image { grid-area: image; }
    .wcc-item-image img { width: 64px; height: 64px; }
    .wcc-item-body { grid-area: body; }
    .wcc-item-pricing {
        grid-area: pricing;
        text-align: left;
        padding-top: 0;
    }
    .wcc-item-price-old-row { justify-content: flex-start; }
    .wcc-item-controls {
        grid-area: controls;
        justify-content: flex-end;
        padding-top: 0;
    }
}
