/* ==============================================
   GoodMood Cart System — Sticky Bar + Drawer
   ============================================== */

/* --- Sticky Cart Bar (bottom of screen) --- */
.gm-cart-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 9000; transform: translateY(100%); transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1); pointer-events: none; }
.gm-cart-bar.visible { transform: translateY(0); pointer-events: auto; }
.gm-cart-bar-inner { max-width: 780px; margin: 0 auto 16px; display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; background: #111827; border-radius: 999px; box-shadow: 0 8px 32px rgba(0,0,0,0.28), 0 0 0 1px rgba(255,255,255,0.06); gap: 1rem; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.gm-cart-bar-info { display: flex; align-items: center; gap: 0.75rem; color: #ffffff; font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; font-size: 0.9375rem; font-weight: 500; white-space: nowrap; min-width: 0; }
.gm-cart-bar-icon { position: relative; font-size: 1.125rem; flex-shrink: 0; }
.gm-cart-bar-count { position: absolute; top: -8px; right: -10px; background: #FFA44E; color: white; font-size: 0.625rem; font-weight: 700; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; line-height: 1; animation: gm-cart-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes gm-cart-pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
.gm-cart-bar-separator { color: #4b5563; font-weight: 300; }
.gm-cart-bar-total { color: #FFA44E; font-weight: 700; }
.gm-cart-bar-cta { display: inline-flex; align-items: center; gap: 0.5rem; padding: 10px 24px; background: #FFA44E; color: white; border: none; border-radius: 999px; font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: all 0.2s; white-space: nowrap; flex-shrink: 0; }
.gm-cart-bar-cta:hover { background: #e8922a; transform: scale(1.03); }
.gm-cart-bar-cta i { font-size: 0.75rem; transition: transform 0.2s; }
.gm-cart-bar-cta:hover i { transform: translateX(2px); }

/* --- Cart Drawer Overlay --- */
.gm-cart-drawer-overlay { position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,0); transition: background 0.2s; display: flex; align-items: flex-end; justify-content: center; }
.gm-cart-drawer-overlay.visible { background: rgba(0,0,0,0.45); transition: background 0.3s; }
.gm-cart-drawer { width: 100%; max-width: 560px; max-height: 85vh; background: #ffffff; border-radius: 20px 20px 0 0; box-shadow: 0 -8px 40px rgba(0,0,0,0.18); transform: translateY(100%); transition: transform 0.2s cubic-bezier(0.4, 0, 1, 1); display: flex; flex-direction: column; overflow: hidden; }
.gm-cart-drawer-overlay.visible .gm-cart-drawer { transform: translateY(0); transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1); }

/* Drawer Header */
.gm-cart-drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 16px; border-bottom: 1px solid #f3f4f6; }
.gm-cart-drawer-title { display: flex; align-items: center; gap: 0.625rem; font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; font-size: 1.125rem; font-weight: 700; color: #111827; }
.gm-cart-drawer-title i { color: #FFA44E; font-size: 1.125rem; }
.gm-cart-drawer-badge { background: #f3f4f6; color: #6b7280; font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.gm-cart-drawer-close { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid #e5e7eb; background: #f9fafb; color: #6b7280; cursor: pointer; transition: all 0.2s; font-size: 0.875rem; }
.gm-cart-drawer-close:hover { background: #f3f4f6; color: #111827; border-color: #d1d5db; }

/* Drawer Items */
.gm-cart-drawer-items { flex: 1; overflow-y: auto; padding: 8px 24px; }
.gm-cart-item { display: flex; align-items: center; gap: 0.875rem; padding: 14px 0; border-bottom: 1px solid #f3f4f6; animation: gm-cart-item-in 0.25s ease; }
@keyframes gm-cart-item-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }
.gm-cart-item:last-child { border-bottom: none; }
.gm-cart-item-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.125rem; flex-shrink: 0; }
.gm-cart-item-info { flex: 1; min-width: 0; }
.gm-cart-item-name { font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; font-size: 0.9375rem; font-weight: 600; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-cart-item-type { font-size: 0.75rem; color: #9ca3af; margin-top: 1px; }
.gm-cart-item-price { font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; font-size: 1rem; font-weight: 700; color: #111827; white-space: nowrap; flex-shrink: 0; }
.gm-cart-item-price span { font-size: 0.75rem; font-weight: 400; color: #9ca3af; }
.gm-cart-item-remove { width: 28px; height: 28px; border-radius: 6px; border: none; background: #fef2f2; color: #ef4444; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; transition: all 0.2s; flex-shrink: 0; }
.gm-cart-item-remove:hover { background: #fee2e2; color: #dc2626; transform: scale(1.1); }

/* Prorated prices in cart items */
.gm-cart-item-price-prorated { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.gm-cart-item-price-prorated .gm-price-original { font-size: 0.75rem; font-weight: 400; color: #9ca3af; text-decoration: line-through; line-height: 1; }
.gm-cart-item-price-prorated .gm-price-prorata { font-size: 1rem; font-weight: 700; color: #FFA44E; line-height: 1.2; }

/* Drawer Footer */
.gm-cart-drawer-footer { border-top: 2px solid #e5e7eb; padding: 20px 24px; background: #fafafa; }
.gm-cart-drawer-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.gm-cart-drawer-total-label { font-size: 0.9375rem; font-weight: 600; color: #374151; }
.gm-cart-drawer-total-amount { font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; font-size: 1.375rem; font-weight: 700; color: #111827; }
.gm-cart-drawer-total-amount span { font-size: 0.8125rem; font-weight: 400; color: #9ca3af; }
.gm-total-prorata { color: #FFA44E !important; }
.gm-cart-prorata-explain { display: flex; align-items: flex-start; gap: 0.5rem; padding: 10px 12px; margin: 8px 0 4px; background: linear-gradient(135deg, #fff7ed 0%, #fffbf5 100%); border-radius: 8px; border: 1px solid #fed7aa; font-size: 0.8125rem; color: #374151; line-height: 1.4; }
.gm-cart-prorata-explain > i { color: #FFA44E; font-size: 0.875rem; flex-shrink: 0; margin-top: 1px; }
.gm-cart-prorata-explain strong { color: #e8922a; }
.gm-cart-prorata-info { display: flex; align-items: center; gap: 0.5rem; padding: 10px 12px; margin: 8px 0 4px; background: #f9fafb; border-radius: 8px; border: 1px solid #e5e7eb; }
.gm-cart-prorata-info > i { color: #FFA44E; font-size: 0.875rem; flex-shrink: 0; }
.gm-cart-prorata-info strong { font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; font-size: 0.875rem; font-weight: 700; color: #111827; }
.gm-cart-prorata-info span { font-size: 0.75rem; color: #9ca3af; margin-left: 2px; }
.gm-cart-prorata-next { font-size: 0.875rem; color: #374151; display: flex; align-items: center; gap: 0.5rem; margin-bottom: 10px; padding: 10px 12px; background: #f9fafb; border-radius: 8px; border: 1px solid #e5e7eb; }
.gm-cart-prorata-next i { color: #FFA44E; font-size: 0.875rem; flex-shrink: 0; }
.gm-cart-prorata-next strong { color: #111827; }
.gm-cart-prorata-downgrade { background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); border-color: #bbf7d0; align-items: flex-start; }
.gm-cart-prorata-downgrade > i { color: #16a34a; }
.gm-cart-prorata-downgrade strong { color: #15803d; }
.gm-cart-prorata-downgrade span { color: #6b7280; display: block; margin-top: 2px; margin-left: 0; }
.gm-cart-drawer-cycle { font-size: 0.8125rem; color: #9ca3af; display: flex; align-items: center; gap: 0.375rem; margin-bottom: 16px; }
.gm-cart-drawer-cycle i { color: #FFA44E; }
.gm-cart-drawer-actions { display: flex; gap: 0.625rem; }
.gm-cart-drawer-actions .gm-btn { flex: 1; justify-content: center; padding: 12px 16px; font-size: 0.9375rem; }
.gm-cart-checkout-btn { background: #FFA44E !important; color: white !important; border-color: #FFA44E !important; font-weight: 600 !important; border-radius: 999px !important; transition: all 0.2s !important; }
.gm-cart-checkout-btn:hover { background: #e8922a !important; border-color: #e8922a !important; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255, 164, 78, 0.35); }
.gm-cart-checkout-btn.loading { opacity: 0.7; pointer-events: none; }
.gm-cart-continue-btn { border-radius: 999px !important; }

/* Empty cart state */
.gm-cart-empty { text-align: center; padding: 2.5rem 1.5rem; color: #9ca3af; }
.gm-cart-empty i { font-size: 2.5rem; margin-bottom: 0.75rem; color: #e5e7eb; }
.gm-cart-empty p { font-size: 0.875rem; margin: 0; }

/* Responsive */
@media (max-width: 640px) {
    .gm-cart-bar-inner { margin: 0 8px 8px; padding: 12px 16px; border-radius: 16px; }
    .gm-cart-bar-info { font-size: 0.8125rem; }
    .gm-cart-bar-cta { padding: 8px 16px; font-size: 0.8125rem; }
    .gm-cart-drawer { max-width: 100%; border-radius: 16px 16px 0 0; }
    .gm-cart-drawer-header { padding: 16px; }
    .gm-cart-drawer-items { padding: 8px 16px; }
    .gm-cart-drawer-footer { padding: 16px; }
    .gm-cart-drawer-actions { flex-direction: column; }
}
