/* Modern Cart Page Styles */
:root {
    --primary-color: #ff2727;
    --primary-hover: #e02020;
    --text-color: #333;
    --light-text: #666;
    --border-color: #e0e0e0;
    --background-gray: #f5f5f5;
    --white: #fff;
    --shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --transition: all 0.2s ease;
    --label-color: #888;
    --breadcrumb-active: #ff2727;
    --breadcrumb-inactive: #d0d0d0;
}

/* Main Cart Container */
.cart-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px 60px;
    color: var(--text-color);
}

/* Removed border-bottom as requested */
.cart-page-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
}

.cart-page-header h1 {
    font-size: 24px;
    font-weight: 500;
    margin: 0;
}

/* Breadcrumbs */
.checkout-breadcrumbs {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto;
    margin-bottom: 30px;
    padding: 0 10px;
    max-width: 400px;
}

.breadcrumb-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 60px;
}

.breadcrumb-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--breadcrumb-inactive);
    color: white;
    font-weight: 600;
    margin-bottom: 8px;
}

.breadcrumb-item.active .breadcrumb-number {
    background-color: var(--breadcrumb-active);
}

.breadcrumb-text {
    font-size: 14px;
    color: var(--light-text);
    font-weight: 500;
}

.breadcrumb-item.active .breadcrumb-text {
    color: var(--primary-color);
    font-weight: 600;
}

.breadcrumb-separator {
    height: 1px;
    background-color: var(--breadcrumb-inactive);
    flex-grow: 1;
    margin: 0 10px;
    position: relative;
    top: -12px;
}

/* Two-column layout */
.cart-layout {
    display: flex;
    gap: 30px;
}

/* Products Column */
.cart-products-column {
    flex: 1.8;
}

/* Cart Header - Desktop and Mobile */
.cart-header {
    display: grid;
    grid-template-columns: minmax(0, 2.5fr) minmax(0, 0.8fr) minmax(0, 0.7fr) 40px;
    align-items: center;
    padding: 0 0 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 500;
    color: var(--light-text);
    margin-bottom: 10px;
}

.mobile-header {
    display: none; /* Hidden on desktop */
}

.header-product, .header-quantity, .header-total, .header-action {
    padding: 0 5px;
}

.header-quantity, .header-total {
    text-align: center;
}

.header-action {
    opacity: 0; /* Hide but maintain spacing */
}

/* Cart Item - Adjusted for the new 3-column layout */
.cart-item {
    display: grid;
    grid-template-columns: minmax(0, 2.5fr) minmax(0, 0.8fr) minmax(0, 0.7fr) 40px;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    transition: opacity 0.3s, transform 0.3s;
}

.cart-item.removing {
    opacity: 0;
    transform: translateX(-20px);
}

/* Product with Image and Info */
.item-product {
    display: flex;
    align-items: center;
    padding-right: 15px;
}

.item-image {
    width: 100px;
    flex-shrink: 0;
    margin-right: 15px;
}

.item-image img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: var(--radius);
}

.item-info {
    min-width: 0; /* Allow text truncation */
}

.item-name {
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 8px;
}

.item-name a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.item-name a:hover {
    color: var(--primary-color);
}

.item-meta {
    margin-bottom: 5px;
}

.item-meta p {
    margin: 5px 0;
    font-size: 14px;
    color: var(--light-text);
}

/* Unit price inside item-info */
.item-unit-price {
    margin-top: 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
}

/* Total Price */
.item-total {
    font-size: 15px;
    font-weight: 400;
    text-align: center;
}

/* Quantity Controls */
.item-quantity {
    display: flex;
    justify-content: center;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    height: 36px;
}

.qty-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.qty-btn svg {
    width: 16px;
    height: 16px;
    color: var(--text-color);
}

.qty-btn:hover {
    background-color: var(--background-gray);
}

.qty-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quanityfields {
    width: 36px;
    height: 36px;
    border: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    -moz-appearance: textfield;
    padding: 0;
}

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

/* Action Buttons - Updated for lighter delete icon */
.item-action {
    text-align: center;
}

.remove-item {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: #ccc; /* Lighter color for X icon */
    transition: var(--transition);
}

.remove-item:hover {
    color: var(--primary-color);
}

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

/* Checkout Summary Column */
.cart-summary-column {
    flex: 1;
}

.cart-summary {
    background-color: var(--background-gray);
    border-radius: var(--radius);
    padding: 20px;
    position: sticky;
    top: 145px;
}

.cart-summary h2 {
    font-size: 15px;
    font-weight: 500;
    margin: 0 0 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 15px;
}

.summary-row.subtotal {
    font-weight: 500;
}

.summary-row.shipping {
    color: var(--light-text);
    margin-bottom: 20px;
}

.summary-row.taxes-note {
    font-size: 13px;
    color: var(--light-text);
    margin-bottom: 25px;
}

.summary-row.taxes-note p {
    margin: 0;
}

.checkout-button-container {
    margin-bottom: 20px;
}

.checkout-button {
    display: block;
    width: 100%;
    padding: 12px 15px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.checkout-button:hover {
    background-color: var(--primary-hover);
}

.continue-shopping {
    text-align: center;
}

.continue-shopping a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--light-text);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.continue-shopping a:hover {
    color: var(--text-color);
}

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

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 60px 0;
}

.empty-cart-content {
    max-width: 400px;
    margin: 0 auto;
}

.empty-cart-icon {
    font-size: 80px;
    color: var(--light-text);
    margin-bottom: 20px;
}

.empty-cart-icon svg {
    width: 80px;
    height: 80px;
    color: var(--light-text);
}

.empty-cart h2 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 10px;
}

.empty-cart p {
    color: var(--light-text);
    margin-bottom: 30px;
}

.continue-shopping-button {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.continue-shopping-button:hover {
    background-color: var(--primary-hover);
}

/* Message Alert */
.message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background-color: var(--white);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    padding: 15px 20px;
    max-width: 90%;
    animation: slideDown 0.3s ease, slideUp 0.3s ease 5s forwards;
}

@keyframes slideDown {
    from { transform: translate(-50%, -20px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes slideUp {
    from { transform: translate(-50%, 0); opacity: 1; }
    to { transform: translate(-50%, -20px); opacity: 0; }
}

.alert {
    padding: 0;
    margin: 0;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 992px) {
    .cart-layout {
        flex-direction: column;
    }
    
    /* Remove order change - products first, then checkout */
    .cart-summary-column {
        margin-bottom: 30px;
    }
    
    .cart-summary {
        position: static;
    }
}

@media (max-width: 768px) {
    .cart-page-container {
        padding: 20px 15px 40px;
    }
    
    .cart-page-header h1 {
        font-size: 22px;
    }
    
    /* Responsive breadcrumbs */
    .breadcrumb-text {
        font-size: 12px;
    }
    
    .breadcrumb-number {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    /* Switch headers for mobile */
    .desktop-header {
        display: none;
    }
    
    .mobile-header {
        display: grid;
        grid-template-columns: 1fr 1fr;
        padding-bottom: 10px;
        margin-bottom: 15px;
    }
    
    .mobile-header .header-total {
        text-align: right;
    }
    
    /* Better mobile layout */
    .cart-item {
        display: block;
        position: relative;
        padding: 15px 0;
    }
    
    .item-product {
        padding-right: 0;
        margin-bottom: 15px;
    }
    
    /* Hide unit price in mobile */
    .item-unit-price {
        display: none;
    }
    
    /* Position the total price at top right */
    .item-total {
        position: absolute;
        top: 15px;
        right: 0;
        text-align: right;
        font-weight: 600;
    }
    
    /* Position quantity controls below product info */
    .item-quantity {
        justify-content: flex-start;
        margin-left: 115px; /* Align with product info */
        margin-bottom: 15px;
    }
    
    /* Position remove button below total price */
    .item-action {
        position: absolute;
        top: 45px; /* Below total price */
        right: 0;
    }

    .remove-item {
        color: #ccc;
    }
}

@media (max-width: 480px) {
    .cart-page-container {
        padding: 15px 10px 30px;
    }
    
    /* Smaller breadcrumbs on very small screens */
    .breadcrumb-separator {
        margin: 0 5px;
    }
    
    .breadcrumb-number {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }
    
    .breadcrumb-text {
        font-size: 11px;
    }
    
    .item-image {
        width: 80px;
    }
    
    .item-image img {
        height: 80px;
    }
    
    .item-name {
        font-size: 15px;
    }
    
    .item-meta p {
        font-size: 13px;
    }
    
    .item-quantity {
        margin-left: 95px; /* Align with smaller product image */
    }
    
    .quantity-controls {
        height: 32px;
    }
    
    .qty-btn, .quanityfields {
        width: 32px;
        height: 32px;
    }
    
    .qty-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .summary-row {
        font-size: 14px;
    }
    
    .checkout-button {
        padding: 10px;
        font-size: 15px;
    }
}