/* cart-styles.css - สไตล์สำหรับหน้าตะกร้าสินค้า */

/* สไตล์สำหรับคอนเทนเนอร์ตะกร้า */
.cart-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin: 0 auto;
}

/* สไตล์สำหรับตะกร้าว่าง */
.empty-cart {
    text-align: center;
    padding: 3rem 0;
}

.empty-cart i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1rem;
}

.empty-cart p {
    color: #777;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

/* สไตล์สำหรับเนื้อหาตะกร้า */
.cart-content {
    width: 100%;
}

/* ส่วนหัวของตะกร้า */
.cart-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr 0.5fr;
    background-color: #f8f8f8;
    padding: 1rem;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.cart-header .cart-product {
    text-align: left;
    padding-left: 1rem;
}

/* รายการสินค้าในตะกร้า */
.cart-items {
    margin-bottom: 1.5rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr 0.5fr;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    align-items: center;
    text-align: center;
}

.cart-product-info {
    display: flex;
    align-items: center;
    text-align: left;
}

.cart-product-image {
    width: 80px;
    height: 80px;
    margin-right: 1rem;
    border-radius: 4px;
    overflow: hidden;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-product-image img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

.cart-product-details {
    flex: 1;
}

.cart-product-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.3rem;
}

.cart-product-sku {
    font-size: 0.8rem;
    color: #777;
}

.cart-product-weight {
    font-size: 0.8rem;
    color: #777;
    margin-top: 0.3rem;
}

.cart-price {
    color: #333;
}

/* สไตล์สำหรับตัวควบคุมจำนวน */
.cart-quantity-control {
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1rem;
    color: #555;
}

.quantity-btn:hover {
    background-color: #eee;
}

.quantity-input {
    width: 40px;
    height: 30px;
    border: 1px solid #ddd;
    text-align: center;
    margin: 0 5px;
    font-size: 0.9rem;
    border-radius: 4px;
}

/* สไตล์สำหรับราคารวมและปุ่มลบ */
.cart-total {
    color: #FF8C00;
    font-weight: 600;
}

.remove-item {
    color: #e74c3c;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.3s;
}

.remove-item:hover {
    color: #c0392b;
}

/* สไตล์สำหรับสรุปตะกร้า */
.cart-summary {
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    font-size: 1rem;
    color: #555;
}

.cart-summary-total {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #eee;
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
}

/* สไตล์สำหรับตัวเลือกการจัดส่ง */
.shipping-options {
    margin-top: 1.5rem;
    border-top: 1px solid #eee;
    padding-top: 1.5rem;
}

.shipping-options h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 1rem;
}

.shipping-method {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    border: 1px solid #eee;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.shipping-method:hover {
    background-color: #f5f5f5;
}

.shipping-method input[type="radio"] {
    margin: 0;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.shipping-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.3rem;
}

.shipping-description {
    font-size: 0.85rem;
    color: #777;
}

.shipping-price {
    font-weight: 600;
    color: #FF8C00;
}

/* สไตล์สำหรับปุ่มดำเนินการต่อ */
.cart-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.continue-shopping {
    color: #555;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s;
}

.continue-shopping:hover {
    color: #FF8C00;
}

.checkout-button {
    background-color: #FF8C00;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkout-button:hover {
    background-color: #E67E00;
}

/* Active shipping method */
.shipping-method.active {
    background-color: #fff8f0;
    border-color: #FF8C00;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .cart-container {
        padding: 1rem;
    }
    
    .cart-header {
        display: none; /* ซ่อนส่วนหัวในโหมดมือถือ */
    }
    
    .cart-item {
        grid-template-columns: 1fr;
        text-align: left;
        gap: 0.8rem;
        padding: 1rem 0;
    }
    
    .cart-product-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cart-product-image {
        width: 100%;
        height: 150px;
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .cart-price, .cart-total {
        display: flex;
        justify-content: space-between;
    }
    
    .cart-price::before {
        content: "ราคา:";
        font-weight: normal;
    }
    
    .cart-total::before {
        content: "ราคารวม:";
        font-weight: normal;
    }
    
    .cart-quantity {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .cart-quantity::before {
        content: "จำนวน:";
    }
    
    .cart-action {
        display: flex;
        justify-content: flex-end;
    }
    
    .shipping-method {
        grid-template-columns: auto 1fr;
        gap: 0.5rem;
    }
    
    .shipping-price {
        grid-column: 2;
        text-align: right;
    }
    
    .cart-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .checkout-button {
        width: 100%;
        justify-content: center;
    }
}

@media screen and (max-width: 576px) {
    .cart-summary-row, .cart-summary-total {
        font-size: 0.9rem;
    }
    
    .shipping-title {
        font-size: 0.9rem;
    }
    
    .shipping-description {
        font-size: 0.75rem;
    }
}

/* เพิ่ม styles เพื่อแสดงผลที่ดีขึ้นบนมือถือ */
@media screen and (max-width: 768px) {
    .cart-item {
        position: relative;
        border: 1px solid #eee;
        border-radius: 8px;
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .remove-item {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }
    
    .cart-product-details {
        padding-right: 2rem; /* เพิ่มพื้นที่สำหรับปุ่มลบ */
    }
    
    .cart-item-meta {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        margin-top: 1rem;
    }
    
    .cart-price, .cart-total, .cart-quantity {
        padding: 0.5rem;
        background-color: #f9f9f9;
        border-radius: 4px;
    }
}
/* เพิ่ม CSS นี้ในไฟล์ cart-styles.css */
.shipping-method.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.shipping-method.disabled label {
    cursor: not-allowed;
}

.shipping-method.disabled input[type="radio"] {
    cursor: not-allowed;
}
/* ส่วนของคูปอง */
.coupon-section {
    margin: 15px 0;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.coupon-form {
    display: flex;
    margin-bottom: 10px;
}

.coupon-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
}

.coupon-form button {
    padding: 10px 15px;
    background-color: #ff8c00;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-weight: bold;
}

.coupon-form button:hover {
    background-color: #e67e00;
}

.active-coupon {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #e8f4ff;
    border-radius: 4px;
    margin-top: 10px;
}

.coupon-info {
    display: flex;
    justify-content: space-between;
    flex: 1;
}

.coupon-discount {
    font-weight: bold;
    color: #28a745;
}

.remove-coupon {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 16px;
}

.coupon-error {
    color: #dc3545;
    margin-top: 5px;
    font-size: 14px;
}