/* =============================================================================
   Cart Block — styles (skompilowane manualnie ze SCSS, bez build pipeline)
   Markup: includes/blocks/cart/view-inner.php
============================================================================= */

.wl-cart-wrapper {
    --wl-cart-primary: #626c44;
    --wl-cart-primary-hover: #4d5535;
    --wl-cart-radius: 12px;
    --wl-cart-radius-sm: 8px;
    --wl-cart-border: #f3f4f6;
    --wl-cart-text: #111827;
    --wl-cart-text-muted: #4b5563;
    --wl-cart-text-soft: #6b7280;
    --wl-cart-text-light: #9ca3af;
    --wl-cart-bg: #ffffff;
    --wl-cart-bg-gray: #f3f4f6;
    --wl-cart-success: #047857;
    --wl-cart-success-bg: #ecfdf5;
    --wl-cart-danger: #dc2626;
    --wl-cart-danger-bg: #fee2e2;

    position: relative;
}

.wl-cart-wrapper .wl-cart-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 16px;
}
@media (min-width: 768px) {
    .wl-cart-wrapper .wl-cart-inner {
        padding: 60px 24px;
    }
}

/* ----- Loader overlay ----- */
.wl-cart-loader {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.7);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.wl-cart-loader.is-visible {
    opacity: 1;
    pointer-events: auto;
}
.wl-cart-loader__inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}
.wl-cart-loader__spinner {
    width: 20px;
    height: 20px;
    animation: wl-cart-spin 1s linear infinite;
    color: #111827;
}
.wl-cart-loader__spinner circle { opacity: 0.25; }
.wl-cart-loader__spinner path { opacity: 0.75; }
.wl-cart-loader__text {
    font-size: 14px;
    color: #404040;
}
@keyframes wl-cart-spin {
    to { transform: rotate(360deg); }
}

/* ----- Empty state ----- */
.wl-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 64px 16px;
}
.wl-cart-empty__icon {
    margin-bottom: 24px;
    color: #d1d5db;
}
.wl-cart-empty__icon svg,
.wl-cart-empty__icon img {
    width: 80px;
    height: 80px;
    display: block;
}
.wl-cart-empty__title {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 600;
    color: #111827;
}
.wl-cart-empty__message {
    margin: 0 0 24px;
    color: #4b5563;
    font-size: 15px;
}
.wl-cart-empty__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    background: #626c44;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s ease;
}
.wl-cart-empty__button:hover,
.wl-cart-empty__button:focus {
    background: #4d5535;
    color: #fff;
}

/* ----- Filled state — grid layout ----- */
.wl-cart-filled {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}
@media (min-width: 1024px) {
    .wl-cart-filled {
        grid-template-columns: repeat(12, 1fr);
        gap: 48px;
    }
}

/* ----- Products column ----- */
@media (min-width: 1024px) {
    .wl-cart-products {
        grid-column: span 8 / span 8;
    }
}
.wl-cart-products__title {
    margin: 0 0 24px;
    font-size: 28px;
    font-weight: 600;
    color: #111827;
}
@media (min-width: 768px) {
    .wl-cart-products__title { font-size: 32px; }
}
.wl-cart-products__back { margin-top: 24px; }
.wl-cart-products__back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #4b5563;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}
.wl-cart-products__back-link svg {
    width: 16px;
    height: 16px;
}
.wl-cart-products__back-link:hover,
.wl-cart-products__back-link:focus {
    color: #111827;
}

/* ----- Items list ----- */
.wl-cart-items {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #ffffff;
    border: 1px solid #f3f4f6;
    border-radius: 12px;
    overflow: hidden;
}
.wl-cart-items > li + li {
    border-top: 1px solid #f3f4f6;
}

.wl-cart-item {
    display: flex;
    gap: 20px;
    padding: 24px;
    align-items: flex-start;
}
@media (max-width: 480px) {
    .wl-cart-item {
        padding: 16px;
        gap: 12px;
    }
}
.wl-cart-item__image { flex-shrink: 0; }
.wl-cart-item__image img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    display: block;
}
@media (max-width: 480px) {
    .wl-cart-item__image img {
        width: 72px;
        height: 72px;
    }
}
.wl-cart-item__details {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.wl-cart-item__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.wl-cart-item__name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: #111827;
}
.wl-cart-item__name a {
    color: inherit;
    text-decoration: none;
}
.wl-cart-item__name a:hover,
.wl-cart-item__name a:focus { color: #4b5563; }

.wl-cart-item__remove {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background: #f3f4f6;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.wl-cart-item__remove svg {
    width: 100%;
    height: 100%;
    color: #9ca3af;
    transition: color 0.2s ease;
}
.wl-cart-item__remove:hover,
.wl-cart-item__remove:focus {
    background: #fee2e2;
}
.wl-cart-item__remove:hover svg,
.wl-cart-item__remove:focus svg {
    color: #dc2626;
}

.wl-cart-item__short-desc {
    font-size: 13px;
    color: #6b7280;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.wl-cart-item__short-desc p { margin: 0; }

.wl-cart-item__meta {
    font-size: 12px;
    color: #4b5563;
}
.wl-cart-item__meta dl {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
}
.wl-cart-item__meta dt {
    margin: 0;
    font-weight: 600;
}
.wl-cart-item__meta dd,
.wl-cart-item__meta dd p { margin: 0; }

.wl-cart-item__price-unit {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: baseline;
}
.wl-cart-item__price-unit del {
    color: #9ca3af;
    text-decoration: line-through;
    font-size: 12px;
    font-weight: 400;
}
.wl-cart-item__price-unit ins {
    color: #b91c1c;
    background: transparent;
    text-decoration: none;
    font-weight: 600;
}
.wl-cart-item__footer {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.wl-cart-item__quantity {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border-radius: 8px;
    overflow: hidden;
}
.wl-cart-item__line-total {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

/* ----- Quantity controls ----- */
.wl-qty-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease;
}
.wl-qty-btn svg {
    width: 16px;
    height: 16px;
    color: #4b5563;
}
.wl-qty-btn:hover:not(:disabled),
.wl-qty-btn:focus:not(:disabled) {
    background: #e5e7eb;
}
.wl-qty-btn:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.wl-qty-value,
.wl-qty-input {
    width: 40px;
    background: transparent;
    border: none;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    -moz-appearance: textfield;
}
.wl-qty-value:focus,
.wl-qty-input:focus { outline: none; }
.wl-qty-value::-webkit-outer-spin-button,
.wl-qty-input::-webkit-outer-spin-button,
.wl-qty-value::-webkit-inner-spin-button,
.wl-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ----- Summary column ----- */
@media (min-width: 1024px) {
    .wl-cart-summary {
        grid-column: span 4 / span 4;
    }
}
.wl-cart-summary__inner {
    position: sticky;
    top: 24px;
    background: #ffffff;
    border: 1px solid #f3f4f6;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.wl-cart-summary__title {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

/* ----- Coupon ----- */
.wl-cart-coupon {
    margin-bottom: 20px;
}
.wl-cart-coupon__form {
    display: flex;
    gap: 8px;
}
.wl-cart-coupon__input {
    flex: 1 1 auto;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #111827;
}
.wl-cart-coupon__input::placeholder { color: #9ca3af; }
.wl-cart-coupon__input:focus {
    outline: none;
    border-color: #9ca3af;
}
.wl-cart-coupon__apply {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #626c44;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.wl-cart-coupon__apply:hover,
.wl-cart-coupon__apply:focus { background: #4d5535; }

.wl-cart-coupon__message {
    margin-top: 8px;
    font-size: 13px;
    display: none;
}
.wl-cart-coupon__message.is-visible { display: block; }
.wl-cart-coupon__message.is-success { color: #047857; }
.wl-cart-coupon__message.is-error   { color: #dc2626; }

.wl-cart-coupon__applied {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.wl-cart-coupon__applied-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 13px;
    background: #ecfdf5;
    border-radius: 8px;
}
.wl-cart-coupon__applied-code {
    font-weight: 500;
    color: #047857;
}
.wl-cart-coupon__remove {
    font-size: 12px;
    color: #047857;
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}
.wl-cart-coupon__remove:hover,
.wl-cart-coupon__remove:focus { color: #025c41; }

/* ----- Totals ----- */
.wl-cart-totals {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}
.wl-cart-totals__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
}
.wl-cart-totals__row--discount .wl-cart-totals__value {
    color: #047857;
    font-weight: 600;
}
.wl-cart-totals__row--total {
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
    font-size: 16px;
}
.wl-cart-totals__row--total .wl-cart-totals__label {
    font-weight: 600;
    color: #111827;
}
.wl-cart-totals__row--total .wl-cart-totals__value {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}
.wl-cart-totals__label { color: #4b5563; }
.wl-cart-totals__value {
    font-weight: 600;
    color: #111827;
}

/* ----- Checkout button ----- */
.wl-cart-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 24px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: #626c44;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s ease;
}
.wl-cart-checkout-btn:hover,
.wl-cart-checkout-btn:focus {
    background: #4d5535;
    color: #fff;
}

/* ----- Notices ----- */
.wl-cart-notices {
    margin-bottom: 24px;
}
