/* Cart Page Styles */
.cart-wrapper {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    margin-bottom: 2rem;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.cart-header h1 {
    margin: 0;
    color: #333;
    font-size: 1.8rem;
}

.item-count {
    background-color: #f8f9fa;
    border-radius: 20px;
    padding: 0.3rem 1rem;
    font-size: 0.9rem;
    color: #666;
}

.cart-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

/* Cart Items */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr 120px;
    gap: 1.5rem;
    padding: 1.5rem;
    background-color: #f9f9f9;
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cart-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.item-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.product-thumbnail-placeholder {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e9ecef;
    border-radius: 8px;
    color: #6c757d;
    font-size: 1.5rem;
}

.item-details {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.item-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-name {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}

.product-name:hover {
    color: #007bff;
}

.item-price {
    color: #555;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quantity-control {
    display: flex;
    align-items: center;
    background-color: #fff;
    border-radius: 6px;
    border: 1px solid #ddd;
    overflow: hidden;
    width: fit-content; /* Ensure it only takes up as much space as needed */
}

.quantity-btn {
    background: none;
    border: none;
    color: #555;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    padding: 0; /* Remove padding to ensure proper alignment */
}

.quantity-btn:hover {
    background-color: #f1f1f1;
}

.quantity-input {
    width: 40px;
    height: 32px;
    text-align: center;
    border: none;
    -moz-appearance: textfield;
    appearance: textfield;
    margin: 0; /* Remove any default margins */
    padding: 0 5px; /* Add some padding inside the input */
    font-size: 0.9rem; /* Slightly reduce font size if needed */
}

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

/* Make the quantity form display inline */
.quantity-form {
    display: inline-flex;
    margin: 0;
}

/* Make sure the item controls are properly aligned */
.item-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap; /* Prevent wrapping to ensure horizontal layout */
}

.remove-item-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 1.1rem;
    transition: transform 0.2s;
}

.remove-item-btn:hover {
    transform: scale(1.15);
}

.item-subtotal {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
}

.subtotal-label {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 0.25rem;
}

.subtotal-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

/* Cart Summary */
.cart-summary {
    background-color: #f9f9f9;
    border-radius: 10px;
    overflow: hidden;
    height: fit-content;
}

.summary-header {
    padding: 1.5rem;
    background-color: #3D7A67;
    color: white;
}

.summary-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.summary-body {
    padding: 1.5rem;
}

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

.summary-divider {
    height: 1px;
    background-color: #ddd;
    margin: 1rem 0;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.checkout-btn-container {
    margin-bottom: 1rem;
}

.btn-checkout {
    display: block;
    width: 100%;
    padding: 0.8rem;
    background-color: #3D7A67;
    border-color: #3D7A67;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-checkout:hover {
    background-color: #356a59;
    border-color: #356a59;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.continue-shopping {
    text-align: center;
    margin-bottom: 1rem;
}

.continue-link {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.continue-link:hover {
    color: #495057;
}

.clear-cart-container {
    text-align: center;
}

.btn-clear-cart {
    font-size: 0.8rem;
    color: #dc3545;
    border-color: #dc3545;
    transition: all 0.2s;
}

.btn-clear-cart:hover {
    background-color: #dc3545;
    color: #fff;
}

/* Empty Cart */
.empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1rem;
}

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

.empty-cart h3 {
    color: #343a40;
    margin-bottom: 0.5rem;
}

.empty-cart p {
    color: #6c757d;
    margin-bottom: 1.5rem;
    max-width: 400px;
}

.btn-start-shopping {
    background-color: #3D7A67;
    border-color: #3D7A67;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-start-shopping:hover {
    background-color: #356a59;
    border-color: #356a59;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Custom confirm dialog styles */
.custom-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-confirm-dialog {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 400px;
    overflow: hidden;
}

.custom-confirm-header {
    background-color: #f8f9fa;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.custom-confirm-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.custom-confirm-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    color: #6c757d;
}

.custom-confirm-body {
    padding: 1rem;
    color: #212529;
}

.custom-confirm-footer {
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.custom-btn {
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    cursor: pointer;
    border: 1px solid transparent;
}

.custom-btn-secondary {
    background-color: #6c757d;
    color: white;
    border-color: #6c757d;
}

.custom-btn-danger {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* Responsive */
@media (max-width: 992px) {
    .cart-container {
        grid-template-columns: 1fr;
    }

    .cart-item {
        grid-template-columns: 80px 1fr;
        grid-template-rows: auto auto;
    }

    .item-image {
        grid-row: span 2;
    }

    .item-subtotal {
        grid-column: 2;
        align-items: flex-start;
        margin-top: 1rem;
    }
}

@media (max-width: 768px) {
    .cart-wrapper {
        padding: 1rem;
    }

    .cart-header h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .cart-item {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .item-image {
        grid-row: 1;
        justify-content: flex-start;
        margin-bottom: 1rem;
    }

    .item-subtotal {
        grid-column: 1;
        grid-row: 3;
        align-items: flex-start;
        margin-top: 1rem;
    }
}