/**
 * Cart Page CSS - Rīgas Ziedi
 * Prefix: rz-cart-* to avoid conflicts
 */

/* ============================================
   CART CONTAINER
   ============================================ */
.rz-cart {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Inter', -apple-system, sans-serif;
}

/* ============================================
   PROGRESS INDICATOR
   ============================================ */
.rz-cart__progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px 0;
}

.rz-cart__progress-step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rz-cart__progress-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    background: #E5E7EB;
    color: #6B7280;
}

.rz-cart__progress-step--active .rz-cart__progress-number {
    background: #09614D;
    color: #fff;
}

.rz-cart__progress-step--completed .rz-cart__progress-number {
    background: #09614D;
    color: #fff;
}

.rz-cart__progress-label {
    font-size: 14px;
    color: #6B7280;
}

.rz-cart__progress-step--active .rz-cart__progress-label {
    color: #05372C;
    font-weight: 500;
}

.rz-cart__progress-line {
    flex: 1;
    max-width: 80px;
    height: 2px;
    background: #E5E7EB;
}

@media (max-width: 500px) {
    .rz-cart__progress-label {
        display: none;
    }
    .rz-cart__progress-line {
        max-width: 40px;
    }
}

/* ============================================
   ITEMS COUNT INFO
   ============================================ */
.rz-cart__info {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    text-align: center;
}

.rz-cart__info-text {
    font-size: 14px;
    color: #166534;
}

.rz-cart__info-text strong {
    font-weight: 600;
}

/* ============================================
   CART ITEMS
   ============================================ */
.rz-cart__items {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.rz-cart__item {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 16px;
    display: grid;
    grid-template-columns: 100px 1fr auto auto auto;
    gap: 16px;
    align-items: start;
}

@media (max-width: 700px) {
    .rz-cart__item {
        grid-template-columns: 80px 1fr auto;
        grid-template-rows: auto auto;
    }
    .rz-cart__item-quantity {
        grid-column: 1 / -1;
    }
    .rz-cart__item-total {
        grid-column: 2 / 3;
    }
}

/* ============================================
   PRODUCT IMAGE
   ============================================ */
.rz-cart__item-image img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

@media (max-width: 600px) {
    .rz-cart__item-image img {
        width: 80px;
        height: 80px;
    }
}

/* ============================================
   PRODUCT INFO
   ============================================ */
.rz-cart__item-info {
    min-width: 0;
}

.rz-cart__item-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 16px;
    font-weight: 600;
    color: #05372C;
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
}

.rz-cart__item-title:hover {
    color: #09614D;
}

.rz-cart__item-unit-price {
    font-size: 14px;
    color: #6B7280;
}

/* ============================================
   QUANTITY CONTROLS
   ============================================ */
.rz-cart__item-quantity {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rz-cart__quantity-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rz-cart__quantity-group label {
    font-size: 12px;
    color: #6B7280;
}

.rz-cart__spinner {
    display: flex;
    align-items: center;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    overflow: hidden;
}

.rz-cart__spinner-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #F9FAFB;
    color: #374151;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.rz-cart__spinner-btn:hover {
    background: #E5E7EB;
}

.rz-cart__spinner-btn:active {
    background: #D1D5DB;
}

.rz-cart__spinner-input {
    width: 50px;
    height: 36px;
    border: none;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    background: #fff;
}

/* ============================================
   PRICE FORMULA & ITEM TOTAL
   ============================================ */
.rz-cart__item-total {
    text-align: right;
    white-space: nowrap;
}

.rz-cart__price-formula {
    font-size: 13px;
    color: #6B7280;
    margin-bottom: 4px;
}

.rz-cart__item-total-sum {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 4px;
}

.rz-cart__item-total-value {
    font-size: 20px;
    font-weight: 600;
    color: #05372C;
}

.rz-cart__item-total-currency {
    font-size: 14px;
    color: #6B7280;
}

/* ============================================
   REMOVE BUTTON
   ============================================ */
.rz-cart__item-remove {
    display: flex;
    align-items: flex-start;
}

.rz-cart__remove-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    background: #fff;
    color: #9CA3AF;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.rz-cart__remove-btn:hover {
    border-color: #DC2626;
    color: #DC2626;
    background: #FEF2F2;
}

.rz-cart__remove-icon {
    line-height: 1;
}

/* ============================================
   CART SUMMARY
   ============================================ */
.rz-cart__summary {
    background: #F9FAFB;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.rz-cart__summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.rz-cart__summary-row--info {
    border-top: 1px solid #E5E7EB;
    margin-top: 8px;
    padding-top: 12px;
}

.rz-cart__summary-label {
    font-size: 16px;
    font-weight: 600;
    color: #05372C;
}

.rz-cart__summary-value {
    font-size: 24px;
    font-weight: 700;
    color: #05372C;
}

.rz-cart__summary-note {
    font-size: 13px;
    color: #6B7280;
    font-style: italic;
}

/* ============================================
   CART ACTIONS
   ============================================ */
.rz-cart__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.rz-cart__btn {
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
}

.rz-cart__btn--primary {
    background: #09614D;
    color: #fff;
    flex: 1;
}

.rz-cart__btn--primary:hover {
    background: #07503F;
}

.rz-cart__btn--secondary {
    background: #fff;
    color: #09614D;
    border: 1.5px solid #09614D;
}

.rz-cart__btn--secondary:hover {
    background: rgba(9, 97, 77, 0.05);
}

/* ============================================
   TRUST BAR
   ============================================ */
.rz-cart__trust {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px;
    background: #FAFAFA;
    border-radius: 8px;
    margin-bottom: 20px;
}

.rz-cart__trust-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #374151;
}

.rz-cart__trust-icon {
    flex-shrink: 0;
}

.rz-cart__trust-divider {
    color: #D1D5DB;
    font-size: 12px;
}

@media (max-width: 500px) {
    .rz-cart__trust {
        gap: 6px;
    }
    .rz-cart__trust-item {
        font-size: 11px;
    }
    .rz-cart__trust-item span:not(.rz-cart__trust-divider) {
        display: none;
    }
    .rz-cart__trust-item:last-child span {
        display: inline; /* Keep Google rating visible */
    }
}

/* ============================================
   EMPTY CART
   ============================================ */
.rz-cart__empty {
    text-align: center;
    padding: 60px 20px;
}

.rz-cart__empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.rz-cart__empty-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 24px;
    color: #05372C;
    margin-bottom: 8px;
}

.rz-cart__empty-text {
    color: #6B7280;
    margin-bottom: 24px;
}

/* ============================================
   FIXED WIDTHS TO PREVENT LAYOUT SHIFT
   ============================================ */
.rz-cart__spinner-input {
    width: 60px !important;  /* Fixed width for 3 digits */
}

.rz-cart__item-total {
    min-width: 140px;  /* Fixed width for price formula */
}

.rz-cart__item-total-value {
    min-width: 80px;
    display: inline-block;
    text-align: right;
}

.rz-cart__price-formula {
    min-width: 120px;
    text-align: right;
}

.rz-cart__unit-price-value {
    min-width: 50px;
    display: inline-block;
    text-align: right;
}

.rz-cart__item-amount {
    min-width: 24px;
    display: inline-block;
    text-align: center;
}

.rz-cart__summary-value {
    min-width: 120px;
    text-align: right;
}

/* ============================================
   FIXES 2026-01-18
   ============================================ */

/* Fix: Google star yellow */
.rz-cart__trust-item:last-child .rz-cart__trust-icon {
    fill: #FBBC04 !important;
}

/* Fix: Primary button better hover/pressed effects */
.rz-cart__btn--primary {
    transition: all 0.2s ease;
}

.rz-cart__btn--primary:hover {
    background: #05473a !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(9, 97, 77, 0.3);
}

.rz-cart__btn--primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(9, 97, 77, 0.2);
    background: #043d32 !important;
}

/* Cart title */
.rz-cart__title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 24px;
    font-weight: 600;
    color: #05372C;
    text-align: center;
    margin: 0 0 16px 0;
}

/* ============================================
   PREMIUM TOGGLE
   ============================================ */
.rz-cart__premium-toggle {
    display: flex;
    gap: 4px;
    margin: 8px 0;
}

.rz-cart__premium-btn {
    padding: 6px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 4px;
    background: #fff;
    color: #6B7280;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.rz-cart__premium-btn:hover {
    border-color: #09614D;
    color: #09614D;
}

.rz-cart__premium-btn--active {
    background: #09614D;
    border-color: #09614D;
    color: #fff;
}

.rz-cart__premium-btn--active:hover {
    background: #07503F;
    color: #fff;
}

/* ============================================
   MOBILE LAYOUT
   ============================================ */
@media (max-width: 600px) {
    .rz-cart__item {
        position: relative;
        display: block;
        padding: 16px;
        padding-right: 50px;
    }
    
    .rz-cart__item-image {
        float: left;
        margin-right: 12px;
        margin-bottom: 8px;
    }
    
    .rz-cart__item-image img {
        width: 70px;
        height: 70px;
    }
    
    .rz-cart__item-remove {
        position: absolute;
        top: 12px;
        right: 12px;
    }
    
    .rz-cart__item-info {
        min-height: 70px;
    }
    
    .rz-cart__item-quantity {
        clear: both;
    }
    
    .rz-cart__quantity-group {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 6px;
    }
    
    .rz-cart__quantity-group label {
        min-width: 110px;
        text-align: left;
        flex-shrink: 0;
    }
    
    .rz-cart__spinner {
        flex-shrink: 0;
    }
    
    .rz-cart__item-total {
        position: absolute;
        right: 16px;
        bottom: 20px;
        text-align: right;
    }
    
    .rz-cart__price-formula {
        font-size: 11px;
    }
    
    .rz-cart__item-total-value {
        font-size: 16px;
    }
}

/* ============================================
   MOBILE FIX - Labels and spinners left
   ============================================ */
@media (max-width: 600px) {
    .rz-cart__item-quantity {
        display: flex;
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .rz-cart__quantity-group {
        width: auto;
    }
    
    .rz-cart__quantity-group label {
        text-align: left;
    }
}

/* ============================================
   MOBILE - Buttons layout
   ============================================ */
@media (max-width: 600px) {
    .rz-cart__actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .rz-cart__btn--primary {
        order: -1;
        width: 100%;
        padding: 16px 24px;
        font-size: 16px;
        font-weight: 600;
    }
    
    .rz-cart__btn--secondary {
        width: 100%;
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* ============================================
   MOBILE - Compact title/progress + show labels
   ============================================ */
@media (max-width: 600px) {
    .rz-cart__title {
        margin-bottom: 4px;
    }
    
    .rz-cart__progress {
        margin-bottom: 8px;
        padding: 4px 0;
        gap: 6px;
    }
    
    .rz-cart__progress-step {
        gap: 4px;
    }
    
    .rz-cart__progress-label {
        display: block !important;
        font-size: 10px;
    }
}
