/* Cart Message */
.message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(120%);
    transition: transform 0.3s ease-in-out;
    max-width: 300px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.message.show {
    transform: translateX(0);
}

.message.success {
    background-color: #4caf50;
}

.message.error {
    background-color: #f44336;
}

.message.info {
    background-color: #2196f3;
}

/* Cart Page Layout */
.cart-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.cart-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.cart-main {
    flex: 1;
    min-width: 0; /* Prevents flex items from overflowing */
}

/* Cart Tabs */
.section-header {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    padding: 0.75rem 1.5rem;
    margin: 0;
    cursor: pointer;
    color: #666;
    font-weight: 500;
    position: relative;
    transition: all 0.2s ease;
    border: none;
    background: none;
}

.section-header h2:hover {
    color: #2e7d32;
}

.section-header h2.active {
    color: #2e7d32;
    font-weight: 600;
}

.section-header h2.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #2e7d32;
}

/* Cart Content Tabs */
.cart-content {
    display: none;
}

.cart-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Wishlist Styles */
.wishlist-grid {
    padding: 1rem 0;
    background: white;
    border-radius: 12px;
    padding: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.wishlist-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.wishlist-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wishlist-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wishlist-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.wishlist-item-details {
    padding: 1rem;
}

.wishlist-item h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    color: #333;
}

.wishlist-item .price {
    font-weight: bold;
    color: #4caf50;
    margin-bottom: 1rem;
    display: block;
}

.wishlist-item-actions {
    display: flex;
    gap: 0.5rem;
}

.wishlist-item-actions button {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.wishlist-item-actions .add-to-cart {
    background-color: #4caf50;
    color: white;
}

.wishlist-item-actions .remove-item {
    background-color: #f5f5f5;
    color: #666;
}

.wishlist-item-actions .add-to-cart:hover {
    background-color: #3e8e41;
}

.wishlist-item-actions .remove-item:hover {
    background-color: #e0e0e0;
}

.empty-wishlist {
    text-align: center;
    padding: 3rem 1rem;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
}

.empty-wishlist i {
    font-size: 3rem;
    color: #e0e0e0;
    margin-bottom: 1rem;
}

.empty-wishlist h3 {
    margin: 0 0 0.5rem;
    color: #333;
}

.empty-wishlist p {
    margin: 0 0 1.5rem;
}

.empty-wishlist .btn {
    padding: 0.75rem 1.5rem;
    background-color: #4caf50;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.empty-wishlist .btn:hover {
    background-color: #3e8e41;
}

#cart-header h2.active {
    color: #2e7d32; /* Green color to match the theme */
    font-weight: 600;
}

#cart-header h2.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #2e7d32;
    border-radius: 2px 2px 0 0;
}

.cart-content {
    display: none;
    opacity: 0;
    gap: 2rem;
    margin-top: 1rem;
    animation: fadeIn 0.3s ease-in-out forwards;
}

.cart-content.active {
    display: flex;
    opacity: 1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.empty-cart {
    text-align: center;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.empty-cart i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1rem;
}

.empty-cart h3 {
    margin: 1rem 0 0.5rem;
    color: #333;
}

.empty-cart p {
    color: #666;
    margin-bottom: 1.5rem;
}

.cart-items {
    flex: 2;
}

.cart-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: white;
    position: relative;
}

.cart-item-image {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
}

.cart-item h4 {
    margin: 0 0 0.5rem;
    color: #333;
    font-size: 1.1rem;
}

.cart-item .price {
    color: #e74c3c;
    font-weight: 600;
    margin: 0.5rem 0;
}


.remove-item {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.remove-item:hover {
    background: #ffebee;
}

.cart-item-total {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
    min-width: 100px;
    text-align: right;
}

/* Cart Summary */
.cart-summary {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 400px;
    min-width: 200px;
    height: fit-content;
    position: sticky;
    top: 2rem;
}

@media (max-width: 480px) {
    .cart-summary {
        width: 100%;
        min-width: 100%;
    }
}

/* Hide summary in wishlist tab */
#wishlist-content + .cart-summary {
    display: none;
}

.cart-summary h3 {
    margin: 0 0 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: #555;
}

.summary-row.total {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
}

.checkout-button {
    width: 100%;
    padding: 0.75rem;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.2s;
}

.checkout-button:hover {
    background: #c0392b;
}

/* Responsive styles */
@media (max-width: 768px) {
    .cart-content {
        flex-direction: column;
    }
    
    .cart-item {
        flex-direction: column;
        padding: 1rem;
    }
    
    .cart-item-image {
        width: 100%;
        height: 200px;
        margin-bottom: 1rem;
    }
    
    .cart-item-total {
        text-align: left;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #eee;
    }
}

/* Cart Page */
.cart-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.cart-items-list {
    margin-bottom: 2rem;
}

.cart-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cart-item-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item-details {
    flex: 1;
}

.cart-item h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.item-total {
    font-weight: 500;
    color: #333;
    margin: 8px 0;
}

.remove-item {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.remove-item:hover {
    background: #ffcdd2;
}

.quantity-controls span {
    min-width: 30px;
    text-align: center;
    font-weight: 500;
}

.remove-item {
    background: #ffebee;
    color: #d32f2f;
    border: 1px solid #ffcdd2;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.remove-item:hover {
    background: #ffcdd2;
}

.cart-summary {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* Detailed Subtotal Styles */
.detailed-subtotal {
    margin-bottom: 0.5rem;
    line-height: 1.5;
    color: #555;
}

.detailed-subtotal-item {
    display: inline-block;
    margin-right: 0.5rem;
}

.subtotal-amount {
    display: block;
    font-weight: 600;
    color: #2e7d32;
    margin-top: 0.5rem;
    font-size: 1.1em;
}

.cart-summary h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.checkout-button {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.2s;
}

.checkout-button:hover {
    background: #43a047;
}

/* Responsive styles */
@media (max-width: 768px) {
    .cart-item {
        flex-direction: column;
    }
    
    .cart-item-image {
        width: 100%;
        height: auto;
        max-height: 200px;
    }
}

/* Cart Count */
.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Add to Cart Button */
.product-card__add-to-cart {
    width: 100%;
    padding: 10px;
    background-color: #2ecc71;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.product-card__add-to-cart:hover {
    background-color: #27ae60;
}

.product-card__add-to-cart:active {
    transform: translateY(1px);
}

/* Disabled state */
.product-card__add-to-cart:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}
