/**
 * Shopping cart page styles
 * Aberdeen Marina Club style
 */

/* Shopping cart container */
.cart-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    padding: 20px 0;
    max-width: 1200px;
    margin: 0 auto;
}

/* Shopping cart main area */
.cart-main {
    flex: 1;
    min-width: 60%;
}

/* Shopping cart sidebar */
.cart-sidebar {
    width: 300px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 20px;
    background-color: #fff;
}

/* Shopping cart title */
.cart-title {
    font-family: 'Cormorant', serif;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

@media (max-width: 768px) {
    .cart-main{
        padding: 20px;
    }
}

/* Center flatpickr calendar for shipping date input on desktop */
@media (min-width: 768px) {
  #shipping-date-input ~ .flatpickr-calendar {
    left: 50% !important;
    top: 20% !important;
    transform: translateX(-50%) !important;
    right: auto !important;
  }
}


.shipping-terms {
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

/* Shopping cart product list */
.cart-product {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    padding: 20px 0;
    position: relative;
}

.cart-product-image {
    width: 80px;
    height: 80px;
    background-color: #f0f0f0;
    margin-right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-product-image img {
    max-width: 100%;
    max-height: 100%;
}

.wine-image {
    text-align: center;
    color: #999;
}

.cart-product-info {
    flex: 1;
}

.cart-product-info-wrapper {
    display: flex;
    gap: 20px;
}

.cart-product-info-wrapper .cart-image {
    flex: 0 0 100px;
}

.cart-product-info-wrapper .product-image {
    max-width: 100px;
}

.cart-product-name {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 16px;
    margin-bottom: 4px;
}

.cart-product-details {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: #666;
    margin-bottom: 2px;
}

.cart-product-code {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: #888;
}

/* Cart Product Remove Button */
.cart-delete-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background-color: #f8f8f8;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    color: #d9534f;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.cart-delete-btn:hover {
    background-color: #d9534f;
    border-color: #d9534f;
    color: white;
}

.cart-delete-btn i {
    margin-right: 5px;
}

@media (max-width: 768px) {
    .cart-delete-btn {
       top: 190px; 
    }
    .cart-delete-btn span {
        display: none;
    }
}

/* Hide the old cart-product-remove button styles to avoid conflicts */
.cart-product-remove {
    display: none;
}

/* Quantity control */
.quantity-control {
    display: flex;
    align-items: center;
    margin-top: 15px;
}

.quantity-label {
    margin-right: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: #666;
}

.quantity-wrapper {
    display: flex;
    align-items: center;
}

/* Update cart quantity selector styles to match product details page */
.cart-quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 4px;
    overflow: hidden;
    height: 36px;
}

.cart-quantity-selector .quantity-btn {
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f5f5f5;
    border: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cart-quantity-selector .quantity-btn:hover {
    background-color: #e5e5e5;
}

.cart-quantity-selector .quantity-input {
    width: 40px;
    height: 100%;
    border: none;
    text-align: center;
    font-size: 14px;
    -moz-appearance: textfield;
    appearance: textfield;
}

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

.sum-label {
    margin-left: 20px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: #666;
}

.unit-price {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #333;
}

/* Subtotal area */
.subtotal-section {
    margin-bottom: 20px;
}

.subtitle {
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 15px;
}

.price-display {
    font-family: 'DM Sans', sans-serif;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 25px;
}

/* Shipping options */
.shipping-section {
    margin-bottom: 25px;
}

.shipping-option {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.shipping-option input[type="radio"] {
    margin-right: 10px;
}

.shipping-option label {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: #333;
}

.shipping-address-select {
    margin-top: 10px;
    margin-left: 25px;
    width: calc(100% - 25px);
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
}

.delivery-select {
    margin-top: 10px;
    margin-left: 25px;
    width: calc(100% - 25px);
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
}

/* Promotion code area */
.promotion-section {
    margin-bottom: 25px;
}

.promotion-input {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.promotion-code { 
    flex: 1;
    height: 40px;
    width: 80%;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
}

.promotion-apply {
    flex: 1;
    height: 40px;
    width: 20%;
    margin-left: 10px;
    padding: 0 5px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 4px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    cursor: pointer;
}

.promotion-apply:hover {
    background-color: #555;
}

/* Email area */
.email-section {
    margin-bottom: 25px;
}

.email-input {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.email-code {
    flex: 1;
    height: 40px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
}

.order-remark {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    margin-bottom: 10px;
    box-sizing: border-box;
    resize: vertical;
}

/* Total area */
.total-section {
    margin-bottom: 25px;
}

.total-price {
    font-family: 'DM Sans', sans-serif;
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin-bottom: 25px;
}

/* Checkout button */
.checkout-button {
    width: 100%;
    height: 50px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 4px;
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.checkout-button:hover {
    background-color: #555;
}

/* Confirm button */
.confirm-button {
    width: 100%;
    height: 50px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 4px;
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.confirm-button:hover {
    background-color: #555;
}

.confirm-button:disabled {
    background-color: #999;
    cursor: not-allowed;
}

/* Delivery address input field */
.delivery-address-container {
    margin-top: 10px;
    margin-left: 25px;
    width: calc(100% - 25px);
    margin-bottom: 15px;
}

.address-input {
    width: 100%;
}

.delivery-address {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
}

/* Terms and conditions checkbox */
.terms-conditions {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #eee;
}

.terms-checkbox {
    display: flex;
    align-items: flex-start;
}

.terms-checkbox input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
}

.terms-checkbox label {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
}

.terms-checkbox a {
    color: #000;
    text-decoration: underline;
}

/* Delivery terms checkbox */
.delivery-terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.delivery-terms-checkbox input[type="checkbox"] {
    margin-top: 3px;
}

.delivery-terms-checkbox label {
    flex: 1;
    cursor: pointer;
}

/* Loading effect */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .cart-container {
        flex-direction: column;
    }
    
    .cart-sidebar {
        width: 100%;
    }
}
