/* assets/css/cart.css */

/* Cart Sidebar / Panel */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    max-width: 100%;
    height: 100%;
    background: var(--color-surface);
    z-index: 2001;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-panel.active {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.cart-header h2 {
    font-size: 1.25rem;
    margin: 0;
}

.cart-close {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--color-text-muted);
}

.cart-close:hover {
    color: var(--color-text-main);
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.cart-item-img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background: var(--color-bg);
}

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

.cart-item-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cart-item-price {
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cart-qty-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    width: fit-content;
    overflow: hidden;
}

.cart-qty-btn {
    background: transparent;
    border: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-text-main);
}

.cart-qty-btn:hover {
    background: var(--color-bg);
}

.cart-qty-input {
    width: 40px;
    height: 30px;
    border: none;
    text-align: center;
    font-weight: 600;
    -moz-appearance: textfield;
}
.cart-qty-input::-webkit-outer-spin-button,
.cart-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cart-item-remove {
    background: transparent;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.cart-item-remove:hover {
    text-decoration: underline;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.btn-checkout {
    width: 100%;
    background: var(--color-primary);
    color: white;
    padding: 1rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
}

.btn-checkout:hover {
    background: var(--color-primary-dark);
}

.cart-empty {
    text-align: center;
    color: var(--color-text-muted);
    padding: 2rem 0;
}

/* Checkout Modal */
.checkout-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.checkout-modal.active {
    opacity: 1;
    visibility: visible;
}

.checkout-content {
    background: var(--color-surface);
    width: 600px;
    max-width: 95%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.checkout-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkout-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.checkout-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    flex: 1;
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
}

.payment-options {
    margin-top: 1rem;
}

.payment-option {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.payment-option:hover,
.payment-option.selected {
    border-color: var(--color-primary);
    background: rgba(22, 101, 52, 0.05);
}

.payment-option input[type="radio"] {
    accent-color: var(--color-primary);
    width: 18px;
    height: 18px;
}

.payment-option-details {
    flex: 1;
}

.payment-option-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.payment-option-desc {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.checkout-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--color-border);
    background: #f8fafc;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--color-primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 4000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ===========================
   Wishlist Panel
   =========================== */
.wishlist-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 100%;
    height: 100%;
    background: var(--color-surface);
    z-index: 2001;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.wishlist-panel.active {
    right: 0;
}

.wishlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.wishlist-header h2 {
    font-size: 1.25rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.wishlist-header h2 i {
    color: var(--color-secondary);
}

.wishlist-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.wishlist-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    animation: fadeInUp 0.25s ease;
}

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

.wishlist-item-img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background: var(--color-bg);
    flex-shrink: 0;
}

.wishlist-item-info {
    flex: 1;
}

.wishlist-item-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--color-text-main);
}

.wishlist-item-price {
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

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

.wishlist-add-cart {
    flex: 1;
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.wishlist-add-cart:hover {
    background: var(--color-primary-dark);
}

.wishlist-remove {
    background: transparent;
    border: 1px solid var(--color-border);
    color: #ef4444;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.wishlist-remove:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

.wishlist-empty {
    text-align: center;
    color: var(--color-text-muted);
    padding: 3rem 1rem;
}

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

.wishlist-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}

.wishlist-footer p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-align: center;
    margin: 0;
}

.wishlist-footer a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
}

.wishlist-footer a:hover {
    text-decoration: underline;
}
