/* ================================================
   components.css — Buttons, Cards, Badges, Inputs, Modals
   ================================================ */

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); padding: var(--space-3) var(--space-6); border-radius: var(--radius-md); font-weight: 500; font-size: var(--text-sm); transition: all var(--transition-base); cursor: pointer; border: 1.5px solid transparent; white-space: nowrap; }
.btn-primary { background: var(--color-primary); color: var(--color-white); }
.btn-primary:hover { background: var(--color-primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--color-white); color: var(--color-primary); border-color: var(--color-primary); }
.btn-secondary:hover { background: var(--color-primary); color: var(--color-white); }
.btn-outline { background: transparent; color: var(--color-text-primary); border-color: var(--color-border); }
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-earth { background: var(--color-earth); color: var(--color-white); }
.btn-earth:hover { background: var(--color-secondary); }
.btn-sm { padding: var(--space-2) var(--space-4); font-size: var(--text-xs); }
.btn-lg { padding: var(--space-4) var(--space-8); font-size: var(--text-base); }
.btn-full { width: 100%; }
.btn-icon { padding: var(--space-3); border-radius: var(--radius-md); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── PRODUCT CARD ── */
.product-card { background: var(--color-surface); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform var(--transition-base), box-shadow var(--transition-base); position: relative; }
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product-card-image { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--color-cream); }
.product-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition-slow); }
.product-card:hover .product-card-image img { transform: scale(1.05); }
.product-card-body { padding: var(--space-4); }
.product-card-brand { font-size: var(--text-xs); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--space-1); }
.product-card-name { font-size: var(--text-sm); font-weight: 500; color: var(--color-text-primary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: var(--space-2); min-height: 2.5rem; }
.product-card-rating { display: flex; align-items: center; gap: var(--space-1); font-size: var(--text-xs); color: var(--color-text-muted); margin-bottom: var(--space-2); }
.product-card-rating .stars { color: #f59e0b; }
.product-card-price { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-3); }
.price-current { font-size: var(--text-base); font-weight: 700; color: var(--color-text-primary); }
.price-mrp { font-size: var(--text-sm); color: var(--color-text-muted); text-decoration: line-through; }
.price-discount { font-size: var(--text-xs); color: var(--color-primary); font-weight: 600; }

/* ── BADGES ── */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.02em; }
.badge-new { background: var(--color-primary); color: var(--color-white); }
.badge-bestseller { background: var(--color-secondary); color: var(--color-white); }
.badge-discount { background: #c0392b; color: var(--color-white); }
.badge-organic { background: #e8f5e9; color: var(--color-primary-dark); }
.badge-free { background: #e3f2fd; color: #1565c0; }

/* Card badges overlay */
.card-badges { position: absolute; top: var(--space-2); left: var(--space-2); display: flex; flex-direction: column; gap: var(--space-1); z-index: 2; }

/* Wishlist button on card */
.wishlist-btn { position: absolute; top: var(--space-2); right: var(--space-2); z-index: 2; background: var(--color-white); border-radius: var(--radius-full); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); transition: all var(--transition-fast); color: var(--color-text-muted); font-size: 1rem; }
.wishlist-btn:hover, .wishlist-btn.active { color: #e53935; background: #fff0f0; }

/* ── INPUTS ── */
.input-group { display: flex; flex-direction: column; gap: var(--space-1); }
.input-label { font-size: var(--text-sm); font-weight: 500; color: var(--color-text-primary); }
.input-label .required { color: var(--color-error); }
.input { width: 100%; padding: var(--space-3) var(--space-4); border: 1.5px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-white); color: var(--color-text-primary); font-size: var(--text-sm); transition: border-color var(--transition-fast); }
.input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(74,124,89,0.1); }
.input.error { border-color: var(--color-error); }
.input-error { font-size: var(--text-xs); color: var(--color-error); }
.input-hint { font-size: var(--text-xs); color: var(--color-text-muted); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%236b5b4e'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
textarea.input { resize: vertical; min-height: 100px; }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }

/* ── MODAL ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: var(--space-4); opacity: 0; pointer-events: none; transition: opacity var(--transition-base); }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal { background: var(--color-surface); border-radius: var(--radius-xl); padding: var(--space-8); max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; position: relative; transform: translateY(20px); transition: transform var(--transition-base); }
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-6); }
.modal-title { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 600; }
.modal-close { background: var(--color-bg); border-radius: var(--radius-full); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; color: var(--color-text-secondary); transition: background var(--transition-fast); }
.modal-close:hover { background: var(--color-border); }

/* ── DIVIDER ── */
.divider { border: none; border-top: 1px solid var(--color-border); margin: var(--space-4) 0; }

/* ── SECTION HEADER ── */
.section-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: var(--space-8); }
.section-title { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 600; }
.section-subtitle { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: var(--space-1); }
.section-link { font-size: var(--text-sm); color: var(--color-primary); font-weight: 500; }
.section-link:hover { text-decoration: underline; }

/* ── RATING STARS ── */
.star-rating { display: flex; gap: 2px; }
.star { color: #d1ccc7; font-size: 1rem; }
.star.filled { color: #f59e0b; }

/* ── EMPTY STATE ── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--space-16) var(--space-8); text-align: center; }
.empty-state-icon { font-size: 4rem; margin-bottom: var(--space-4); }
.empty-state h3 { font-family: var(--font-display); margin-bottom: var(--space-2); }
.empty-state p { color: var(--color-text-muted); margin-bottom: var(--space-6); }

/* ── BREADCRUMB ── */
.breadcrumb { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--space-4); }
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb-sep { color: var(--color-border); }

/* ── TABS ── */
.tabs { display: flex; border-bottom: 2px solid var(--color-border); margin-bottom: var(--space-6); }
.tab-btn { padding: var(--space-3) var(--space-6); font-size: var(--text-sm); font-weight: 500; color: var(--color-text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all var(--transition-fast); cursor: pointer; }
.tab-btn:hover { color: var(--color-primary); }
.tab-btn.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── CHIP/TAG ── */
.chip { display: inline-flex; align-items: center; gap: var(--space-1); padding: var(--space-1) var(--space-3); border-radius: var(--radius-full); background: var(--color-cream); border: 1px solid var(--color-border); font-size: var(--text-xs); color: var(--color-text-secondary); }
.chip-remove { cursor: pointer; color: var(--color-text-muted); }
.chip-remove:hover { color: var(--color-error); }

/* ── DRAWER ── */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 380px; background: var(--color-surface); box-shadow: var(--shadow-xl); z-index: 900; transform: translateX(100%); transition: transform var(--transition-slow); overflow-y: auto; }
.drawer.open { transform: translateX(0); }
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 899; opacity: 0; pointer-events: none; transition: opacity var(--transition-base); }
.drawer-overlay.visible { opacity: 1; pointer-events: all; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-6); border-bottom: 1px solid var(--color-border); position: sticky; top: 0; background: var(--color-surface); z-index: 1; }

/* ── OFFER BAR ── */
#offer-bar { background: var(--color-primary); color: var(--color-white); text-align: center; padding: var(--space-2) var(--space-4); font-size: var(--text-sm); position: relative; }
#offer-bar .close-offer { position: absolute; right: var(--space-4); top: 50%; transform: translateY(-50%); cursor: pointer; opacity: 0.7; }
#offer-bar .close-offer:hover { opacity: 1; }

/* ── BACK TO TOP ── */
#back-to-top { position: fixed; bottom: var(--space-8); right: var(--space-8); width: 44px; height: 44px; border-radius: var(--radius-full); background: var(--color-primary); color: var(--color-white); font-size: 1.2rem; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transition: all var(--transition-base); z-index: 500; }
#back-to-top.visible { opacity: 1; pointer-events: all; }
#back-to-top:hover { background: var(--color-primary-dark); transform: translateY(-2px); }

/* ── PROGRESS BAR ── */
.progress-bar { height: 6px; background: var(--color-border); border-radius: var(--radius-full); overflow: hidden; }
.progress-fill { height: 100%; background: var(--color-primary); border-radius: var(--radius-full); transition: width var(--transition-slow); }

/* ── QUANTITY CONTROL ── */
.qty-control { display: inline-flex; align-items: center; border: 1.5px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; }
.qty-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--color-bg); color: var(--color-text-primary); font-size: 1.1rem; transition: background var(--transition-fast); cursor: pointer; }
.qty-btn:hover { background: var(--color-primary); color: var(--color-white); }
.qty-value { width: 44px; text-align: center; font-weight: 600; font-size: var(--text-sm); border-left: 1px solid var(--color-border); border-right: 1px solid var(--color-border); height: 36px; line-height: 36px; }

/* ── CHECKBOX & RADIO ── */
.checkbox-group, .radio-group { display: flex; flex-direction: column; gap: var(--space-2); }
.checkbox-item, .radio-item { display: flex; align-items: center; gap: var(--space-2); cursor: pointer; font-size: var(--text-sm); }
.checkbox-item input, .radio-item input { width: 16px; height: 16px; accent-color: var(--color-primary); cursor: pointer; }
