/* ==========================
Cover Photo
=========================== */
/* .cart_cover_photo img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #ddd;
    display: block;
} */
/* =========================
    CART ITEM SECTION
========================= */
.cart-items-section {
    background-color: #ffffff;
    padding: 1rem;
    margin-bottom: 0.7rem;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.cart-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #111827;
}

.cart-view-toggle {
    display: flex;
    margin-bottom: 1rem;
    justify-content: space-between;
    align-items: flex-start;
}

.cart-view-toggle button {
    padding: 0.1rem 0.3rem;
    border: 1px solid #ddd;
    background: #f3f4f6;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9rem;
}

/* ปุ่ม active */
.cart-view-toggle button.active {
    background: #FF9800;
    color: white;
    border-color: #FF9800;
    pointer-events: auto;
}

/* hover เฉพาะปุ่มที่ไม่ active */
.cart-view-toggle button:not(.active):hover {
    background: #e5e7eb;
}

.cart-item-list.list-mode {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.cart-item-list.grid-mode {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

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

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-list.grid-mode .cart-item {
    flex-direction: column;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 1rem;
}

.cart-item-info {
    display: flex;
    /* align-items: center; */
    gap: 1rem;
}

.item-image {
    width: 5rem;
    height: 5rem;
    margin-bottom: 5px;
    border-radius: 0.75rem;
    object-fit: cover;
    border: 1px solid #e5e7eb;
}

.item-details {
    display: flex;
    flex-direction: column;
}

.item-name {
    font-weight: 600;
    font-size: 1rem;
    color: #111827;
    text-align: center;
}

.item-size {
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
}

.item-remove {
    font-size: 0.75rem;
    text-align: left;
    color: #ef4444;
    margin-top: 0.25rem;
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.2s ease-in-out;
}

.item-remove:hover {
    color: #dc2626;
    text-decoration: underline;
}

.item-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    flex-direction: column-reverse;
}

.item-quantity {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 9999px;
    background: #f9fafb;
    overflow: hidden;
}

.quantity-input {
    border: none !important;
    background: #f9fafb !important;
    text-align: right !important;
}

.quantity-input:focus,
.quantity-input:focus-visible {
    outline: 2px solid #3b82f6;
}

.quantity-button {
    padding: 0.4rem 0.8rem;
    font-size: 1rem;
    color: #2563eb;
    cursor: pointer;
    background: none;
    border: none;
    font-weight: 700;
    transition: background 0.2s;
}

.quantity-button:hover {
    background: #e0f2fe;
}

.quantity-value {
    padding: 0 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    color: #111827;
}

.item-price {
    font-weight: 700;
    font-size: 1.125rem;
    color: #111827;
}

.cart-empty {
    text-align: center;
    border: 2px dashed #5555;
    padding: 2rem;
}

/* =========================
    SUMMARY SECTION
========================= */
.summary-section {
    width: 100%;
    padding: 1rem;
    margin-top: 0.7rem;
    background-color: #ffffff;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.summary-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #111827;
}

.summary-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: #374151;
}

.summary-subtotal {
    font-weight: 700;
    font-size: 1.125rem;
    padding-top: 0.75rem;
    border-top: 1px solid #d1d5db;
    color: #111827;
}

.summary-total {
    font-weight: bold;
    font-size: 1.2rem;
}

.checkout-button {
    width: 100%;
    background-color: #22c55e;
    color: white;
    font-weight: 700;
    padding: 0.5rem;
    border-radius: 0.75rem;
    border: none;
    transition: all 0.2s ease-in-out;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.checkout-button:hover {
    background-color: #16a34a;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.3);
}


/* =========================
Service SECTION
========================= */

.service-section {
    width: 100%;
    padding: 1rem;
    margin-top: 0.7rem;
    background-color: #ffffff;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.service-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #111827;
}

.service-label {
    margin-right: 1rem;
}

/* =========================
delivery SECTION
========================= */

.shipping-label {
    margin-right: 1rem;
}

.delivery-section {
    width: 100%;
    padding: 1rem;
    /* margin-top: 0.7rem; */
    background-color: #ffffff;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.delivery-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #111827;
}

/* .delivery-method {
    margin: 0.5rem 0;
} */

.delivery-options {
    margin: 0.5rem 0;
    padding-top: 0.7rem;
    border-top: 1px solid #d1d5db;
}

.delivery-label {
    margin-right: 1rem;
    cursor: pointer;
    /* display: block; */
    display: none;
}

/* .delivery-method label,
.delivery-options label {
    
} */

/* .summary-weight-card {
    width: 100%;
    padding: 1rem;
    margin-top: 0.7rem;
    background-color: #ffffff;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
} */

/* =========================
TERMS SECTION
========================= */
.terms-text {
    font-size: 0.8rem;
}

/* =========================
DISCOUNT SECTION
========================= */
.discount-section {
    margin-top: 0.7rem;
    padding: 1rem;
    background: #ffffff;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.discount-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #111827;
}

.coupon-btn {
    width: 100%;
    padding: 1rem;
    margin-bottom: 8px;
    border: 2px dashed #22c55e;
    /* border-radius: 0.75rem; */
    background: #fff;
    color: #22c55e;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-size: 1rem;
}

.coupon-btn:hover {
    background: #ecfdf5;
    transform: scale(1.02);
}

.discount-code-group {
    margin-top: 0.5rem;
}

.discount-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    font-size: 1rem;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
}

.discount-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px #93c5fd;
}

.discount-apply-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 0.5rem;
    border: none;
    border-radius: 0.75rem;
    background: #2563eb;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s ease-in-out, transform 0.2s;
}

.discount-apply-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.coupon-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #ccc;
}

.coupon-btn.disabled:hover {
    background-color: #ccc;
}