/* Cart-specific styles that integrate with the main design system */
main {
    padding-top: 80px; /* Account for fixed header */
    min-height: calc(100vh - 80px);
    background-color: #f8faf9;
}

.cart-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.cart-header {
    text-align: center;
    margin-bottom: 30px;
}

.cart-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #b0302f 0%, #8b2635 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cart-controls {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.select-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #2d3748;
    cursor: pointer;
}

.select-all-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #b0302f;
}

.control-buttons {
    display: flex;
    gap: 10px;
}

.control-btn {
    background: #b0302f;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.control-btn:hover {
    background: #912323;
}

.selected-info {
    font-size: 1rem;
    color: #4a5568;
    text-align: center;
    padding: 10px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.selected-total {
    color: #b0302f;
    font-weight: 700;
}

.cart-table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.cart-table table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table th {
    background: linear-gradient(135deg, #b0302f 0%, #8b2635 100%);
    color: white;
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.cart-table td {
    padding: 20px 10px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.cart-table tbody tr:hover {
    background-color: #f7fafc;
}

.cart-table tbody tr:last-child td {
    border-bottom: none;
}

.item-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #b0302f;
}

.product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    transition: transform 0.3s ease;
}

.product-image:hover {
    transform: scale(1.1);
}

.product-details {
    text-align: left;
    max-width: 250px;
}

.product-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.product-meta {
    font-size: 0.85rem;
    color: #718096;
    margin-bottom: 4px;
}

.selectors-cell {
    min-width: 180px;
}

.selector-group {
    margin-bottom: 8px;
}

.selector-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 4px;
}

.variation-selector, .size-selector {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #b0302f;
    border-radius: 5px;
    font-size: 0.85rem;
    background: white;
    color: #2d3748;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.variation-selector:focus, .size-selector:focus {
    outline: none;
    border-color: #912323;
    box-shadow: 0 0 0 2px rgba(176, 48, 47, 0.2);
}

.price-cell {
    font-weight: 600;
    color: #b0302f;
    font-size: 1.1rem;
}

.quantity-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.quantity-input {
    width: 70px;
    padding: 6px;
    text-align: center;
    border: 1px solid #b0302f;
    border-radius: 5px;
    font-size: 0.9rem;
}

.stock-info {
    font-size: 0.75rem;
    color: #718096;
}

.update-btn {
    background: #b0302f;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.3s ease;
}

.update-btn:hover {
    background: #912323;
}

.total-cell {
    font-weight: 700;
    color: #2d3748;
    font-size: 1.1rem;
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.3s ease;
}

.remove-btn:hover {
    background: #c82333;
}

.cart-summary {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.summary-total {
    border-top: 2px solid #e2e8f0;
    padding-top: 15px;
    margin-top: 15px;
    font-size: 1.3rem;
    font-weight: 700;
}

.cart-total {
    color: #718096;
}

.selected-total-amount {
    color: #b0302f;
}

.checkout-btn {
    width: 100%;
    background: linear-gradient(135deg, #b0302f 0%, #8b2635 100%);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(176, 48, 47, 0.3);
}

.checkout-btn:disabled {
    background: #e2e8f0;
    color: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.empty-cart {
    background: white;
    border-radius: 10px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.empty-cart h3 {
    font-size: 1.8rem;
    color: #4a5568;
    margin-bottom: 20px;
}

.empty-cart p {
    color: #718096;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.error-message, .success-message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
}

.error-message {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.success-message {
    background: #c6f6d5;
    color: #2f855a;
    border: 1px solid #9ae6b4;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .cart-title {
        font-size: 2rem;
    }

    .select-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .cart-table {
        font-size: 0.85rem;
    }

    .cart-table th,
    .cart-table td {
        padding: 10px 5px;
    }

    .selectors-cell {
        min-width: 120px;
    }

    .product-details {
        max-width: 180px;
    }

    .quantity-input {
        width: 60px;
    }
}

@media (max-width: 480px) {
    .cart-container {
        padding: 20px 10px;
    }

    .cart-title {
        font-size: 1.8rem;
    }

    .cart-table {
        font-size: 0.8rem;
    }

    .selectors-cell {
        min-width: 100px;
    }

    .product-details {
        max-width: 150px;
    }
}

/* Recommendations Section */
.recommendations-section {
    margin-top: 40px;
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.recommendations-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 25px;
    text-align: center;
    background: linear-gradient(135deg, #b0302f 0%, #8b2635 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.recommendations-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.recommendation-link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

.recommendation-link:hover {
    transform: translateY(-5px);
}

.recommendation-product {
    background: #f7fafc;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.recommendation-product:hover {
    box-shadow: 0 4px 15px rgba(176, 48, 47, 0.2);
    border-color: #b0302f;
}

.recommendation-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 2px solid #e2e8f0;
}

.recommendation-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.recommendation-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
    line-height: 1.4;
}

.recommendation-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #b0302f;
    margin-bottom: 8px;
}

.recommendation-stock {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 0;
}

/* Mobile adjustments for recommendations */
@media (max-width: 768px) {
    .recommendations-title {
        font-size: 1.6rem;
    }

    .recommendations-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }

    .recommendation-image {
        height: 140px;
    }
}

@media (max-width: 480px) {
    .recommendations-section {
        padding: 20px 15px;
    }

    .recommendations-title {
        font-size: 1.4rem;
    }

    .recommendations-container {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .recommendation-product {
        padding: 15px;
    }

    .recommendation-image {
        height: 120px;
    }

    .recommendation-name {
        font-size: 1rem;
    }

    .recommendation-price {
        font-size: 1.1rem;
    }
}

/* Desktop: hide mobile cart items */
.mobile-cart-items {
    display: none;
}

@media (max-width: 768px) {
    /* Hide table on mobile and show card layout */
    .cart-table table {
        display: none;
    }

    .mobile-cart-items {
        display: block;
    }
}

@media (max-width: 480px) {
    /* Hide table on mobile and show card layout */
    .cart-table table {
        display: none;
    }

    .cart-table {
        display: block;
    }

    /* Mobile cart cards */
    .mobile-cart-item {
        display: block;
        background: white;
        border-radius: 12px;
        padding: 16px;
        margin-bottom: 16px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        border: 1px solid #e2e8f0;
    }

    .mobile-item-header {
        display: flex;
        align-items: flex-start;
        margin-bottom: 12px;
    }

    .mobile-item-checkbox {
        margin-right: 12px;
        margin-top: 4px;
    }

    .mobile-item-image {
        width: 60px;
        height: 60px;
        object-fit: cover;
        border-radius: 8px;
        margin-right: 12px;
        flex-shrink: 0;
    }

    .mobile-item-details {
        flex: 1;
    }

    .mobile-item-name {
        font-weight: 600;
        font-size: 0.9rem;
        margin-bottom: 4px;
        color: #2d3748;
        line-height: 1.3;
    }

    .mobile-item-meta {
        font-size: 0.8rem;
        color: #718096;
        margin-bottom: 2px;
    }

    .mobile-item-price {
        font-weight: 600;
        color: #b0302f;
        font-size: 0.9rem;
        margin-top: 4px;
    }

    .mobile-item-controls {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #e2e8f0;
        flex-wrap: wrap;
        gap: 8px;
    }

    .mobile-selectors {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        flex: 1;
    }

    .mobile-selectors select {
        font-size: 0.75rem;
        padding: 4px 6px;
        border-radius: 4px;
        border: 1px solid #d2d6dc;
        background: white;
        min-width: 60px;
    }

    .mobile-quantity-control {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-quantity-input {
        width: 45px;
        padding: 4px 6px;
        text-align: center;
        border: 1px solid #d2d6dc;
        border-radius: 4px;
        font-size: 0.8rem;
    }

    .mobile-item-total {
        font-weight: 600;
        color: #2d3748;
        font-size: 0.9rem;
        margin-left: 8px;
    }

    .mobile-remove-btn {
        background: #e53e3e;
        color: white;
        border: none;
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 0.75rem;
        cursor: pointer;
        margin-left: auto;
    }

    .mobile-remove-btn:hover {
        background: #c53030;
    }
}