/* Cart page styles */
.cart-page,
.cart-page *,
.cart-page *::before,
.cart-page *::after {
    box-sizing: border-box;
}

.cart-page {
    width: 100%;
    padding: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.cart-page__breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    color: #7b8794;
    font-size: 14px;
}

.cart-page__breadcrumbs a {
    color: #7b8794;
    text-decoration: none;
}

.cart-page__breadcrumbs a:hover {
    color: #4cc33c;
}

.cart-page__title {
    margin: 0 0 28px 0;
    font-size: 28px;
    font-weight: 700;
    color: #1f2933;
}

/* Rigla cart styles */
.rigla-cart {
    width: 100%;
    min-width: 0;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8e4;
    overflow: hidden;
}

/* Empty cart */
.rigla-cart__empty {
    padding: 60px 20px;
    text-align: center;
}

.rigla-cart__empty-icon {
    margin-bottom: 20px;
    color: #e2e8e4;
}

.rigla-cart__empty-title {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 700;
    color: #1f2933;
}

.rigla-cart__empty-text {
    margin: 0 0 24px 0;
    color: #6b7280;
    font-size: 16px;
}

.rigla-cart__empty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    padding: 14px 28px;
    border-radius: 14px;
    background: #4cc33c;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s ease;
}

.rigla-cart__empty-btn:hover {
    background: #3aaa2d;
}

/* Cart content */
.rigla-cart__content {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}

.rigla-cart__items {
    min-width: 0;
    padding: 12px;
}

/* Cart header */
.rigla-cart__header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 50px;
    gap: 16px;
    padding: 12px 16px;
    background: #f6f8f7;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 16px;
}

.rigla-cart__header-actions {
    width: 50px;
}

/* Cart item */
.rigla-cart__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "product actions"
        "price price"
        "quantity sum";
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid #e2e8e4;
    align-items: center;
}

.rigla-cart__item:last-child {
    border-bottom: none;
}

.rigla-cart__item-product {
    grid-area: product;
    display: flex;
    min-width: 0;
    gap: 12px;
    align-items: center;
}

.rigla-cart__item-image {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #f4faf3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rigla-cart__item-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.rigla-cart__item-image--empty {
    background: linear-gradient(135deg, #f4fbf1 0%, #eef7ec 100%);
}

.rigla-cart__item-image--empty span {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #4cc33c;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.rigla-cart__item-info {
    flex: 1;
    min-width: 0;
}

.rigla-cart__item-name {
    display: block;
    color: #1f2933;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.4;
    margin-bottom: 4px;
    overflow-wrap: anywhere;
}

.rigla-cart__item-name:hover {
    color: #4cc33c;
}

.rigla-cart__item-props {
    font-size: 13px;
    color: #6b7280;
}

.rigla-cart__item-props span {
    margin-right: 12px;
}

/* Price */
.rigla-cart__item-price {
    grid-area: price;
    text-align: left;
}

.rigla-cart__item-price-old {
    font-size: 13px;
    color: #9ca3af;
    text-decoration: line-through;
    margin-bottom: 4px;
}

.rigla-cart__item-price-current {
    font-size: 16px;
    font-weight: 700;
    color: #1f2933;
}

/* Quantity */
.rigla-cart__item-quantity {
    grid-area: quantity;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rigla-cart__quantity-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8e4;
    border-radius: 8px;
    background: #ffffff;
    color: #1f2933;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rigla-cart__quantity-btn:hover {
    border-color: #4cc33c;
    color: #4cc33c;
}

.rigla-cart__quantity-input {
    width: 56px;
    height: 44px;
    text-align: center;
    border: 1px solid #e2e8e4;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

.rigla-cart__quantity-input:focus {
    outline: none;
    border-color: #4cc33c;
}

/* Sum */
.rigla-cart__item-sum {
    grid-area: sum;
    text-align: right;
    font-size: 16px;
    font-weight: 700;
    color: #1f2933;
}

/* Actions */
.rigla-cart__item-actions {
    grid-area: actions;
    width: auto;
    display: flex;
    justify-content: center;
}

.rigla-cart__item-delete {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rigla-cart__item-delete:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* Summary */
.rigla-cart__summary {
    padding: 16px;
    background: #f6f8f7;
    border-top: 1px solid #e2e8e4;
}

.rigla-cart__summary-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 15px;
    color: #6b7280;
    border-bottom: 1px solid #e2e8e4;
}

.rigla-cart__summary-row--discount {
    color: #dc2626;
}

.rigla-cart__summary-row--total {
    font-size: 20px;
    font-weight: 700;
    color: #1f2933;
    border-bottom: none;
    padding-top: 16px;
}

/* Coupon */
.rigla-cart__coupon {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 20px 0;
}

.rigla-cart__coupon-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8e4;
    border-radius: 10px;
    font-size: 14px;
    background: #ffffff;
}

.rigla-cart__coupon-input:focus {
    outline: none;
    border-color: #4cc33c;
}

.rigla-cart__coupon-btn {
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    background: #e2e8e4;
    color: #1f2933;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rigla-cart__coupon-btn:hover {
    background: #cbd5e1;
}

/* Checkout button */
.rigla-cart__checkout-btn {
    display: block;
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    background: #4cc33c;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s ease;
    box-shadow: 0 16px 28px rgba(76, 195, 60, 0.22);
}

.rigla-cart__checkout-btn:hover {
    background: #3aaa2d;
}

.rigla-cart__continue {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 14px;
    border: 1px solid #e2e8e4;
    border-radius: 14px;
    background: #ffffff;
    color: #1f2933;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.rigla-cart__continue:hover {
    border-color: #4cc33c;
    color: #4cc33c;
}

/* Responsive */
@media (min-width: 576px) {
    .cart-page {
        padding: 24px;
    }

    .rigla-cart {
        border-radius: 16px;
    }

    .rigla-cart__items {
        padding: 20px;
    }

    .rigla-cart__item {
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 18px 0;
    }

    .rigla-cart__item-image {
        width: 72px;
        height: 72px;
    }

    .rigla-cart__coupon {
        flex-direction: row;
    }
}

@media (min-width: 768px) {
    .rigla-cart__header {
        grid-template-columns: minmax(0, 1.5fr) minmax(110px, 0.7fr) minmax(150px, 0.8fr) minmax(110px, 0.7fr) 44px;
        gap: 14px;
    }

    .rigla-cart__item {
        grid-template-columns: minmax(0, 1.5fr) minmax(110px, 0.7fr) minmax(150px, 0.8fr) minmax(110px, 0.7fr) 44px;
        grid-template-areas: "product price quantity sum actions";
        gap: 14px;
        padding: 18px 12px;
    }

    .rigla-cart__item-price,
    .rigla-cart__item-sum {
        text-align: right;
    }

    .rigla-cart__item-actions {
        justify-content: center;
    }
}

@media (min-width: 992px) {
    .rigla-cart__content {
        grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
    }

    .rigla-cart__summary {
        padding: 24px;
        border-top: none;
        border-left: 1px solid #e2e8e4;
    }
}

@media (min-width: 1200px) {
    .cart-page {
        padding: 28px;
    }

    .rigla-cart {
        border-radius: 20px;
    }

    .rigla-cart__content {
        grid-template-columns: minmax(0, 1fr) 320px;
    }

    .rigla-cart__items {
        padding: 24px;
    }

    .rigla-cart__header {
        grid-template-columns: minmax(0, 2fr) 1fr 1fr 1fr 50px;
        gap: 16px;
    }

    .rigla-cart__item {
        grid-template-columns: minmax(0, 2fr) 1fr 1fr 1fr 50px;
        gap: 16px;
        padding: 20px 16px;
    }

    .rigla-cart__item-image {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 767.98px) {
    .cart-page__title {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .rigla-cart__header {
        display: none;
    }
}
