/* ===== CarTechMax Shop Styles — v3.0 Orange Theme ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', -apple-system, sans-serif; background: #111318; color: #e2e8f0; }
.hidden { display: none !important; }

/* --- Admin Bar --- */
.admin-bar { background: #1a1d25; color: #fff; padding: 0.15rem 0; border-bottom: 2px solid #e67e22; z-index: 1000; position: relative; }
.admin-inner { max-width: 1280px; margin: 0 auto; padding: 0.25rem 1.5rem; display: flex; align-items: center; justify-content: space-between; height: 36px; }
.admin-badge { background: #e67e22; color: white; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.7rem; font-weight: 800; }
.admin-links { display: flex; gap: 1.5rem; }
.admin-links a { color: #cbd5e1; text-decoration: none; font-size: 0.8rem; font-weight: 700; }
.admin-links a:hover { color: #f59e0b; text-decoration: underline; }

/* --- Top Bar --- */
.top-bar { background: linear-gradient(90deg, #1a1d25, #2a2520, #1a1d25); color: #a89070; text-align: center; padding: 0.5rem; font-size: 0.8rem; letter-spacing: 0.02em; border-bottom: 1px solid #2d2418; }

/* --- Navigation --- */
.main-nav { background: #1a1d25; border-bottom: 1px solid #2a2d35; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 12px rgba(0,0,0,0.3); }
.nav-inner { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; height: 68px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.logo-icon { font-size: 1.5rem; }
.logo-img { height: 36px; width: auto; max-width: 140px; object-fit: contain; }
.logo-text { font-size: 1.3rem; font-weight: 900; background: linear-gradient(135deg, #e67e22, #f59e0b); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.nav-links { display: flex; gap: 0.25rem; }
.nav-link { padding: 0.5rem 1rem; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 0.9rem; color: #94a3b8; transition: all 0.2s; }
.nav-link:hover, .nav-link.active { background: rgba(230,126,34,0.1); color: #f59e0b; }
.nav-actions { display: flex; gap: 0.5rem; }
.nav-btn { background: #252830; border: 1px solid #3a3d45; padding: 0.5rem 0.75rem; border-radius: 8px; cursor: pointer; font-size: 1.1rem; position: relative; transition: all 0.2s; color: #e2e8f0; }
.nav-btn:hover { background: #3a3d45; border-color: #e67e22; }
.btn-text { font-size: 0.85rem; font-weight: 700; margin-left: 0.25rem; color: #94a3b8; }
.badge { position: absolute; top: -4px; right: -4px; background: #e67e22; color: #fff; font-size: 0.7rem; font-weight: 700; padding: 0.1rem 0.35rem; border-radius: 999px; }

/* --- Hero --- */
.hero { background: linear-gradient(135deg, #0f1015 0%, #1a1408 30%, #2a1a0a 50%, #1a1408 70%, #0f1015 100%); color: #fff; padding: 5rem 2rem; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(230,126,34,0.08) 0%, transparent 70%); pointer-events: none; }
.hero-title { font-size: 2.8rem; font-weight: 900; line-height: 1.2; margin-bottom: 1rem; position: relative; }
.gradient-text { background: linear-gradient(90deg, #e67e22, #f59e0b, #e67e22); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-subtitle { font-size: 1.1rem; color: #8a8070; max-width: 600px; margin: 0 auto 2rem; line-height: 1.6; position: relative; }
.hero-badges { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; position: relative; }
.hero-badge { background: rgba(230,126,34,0.12); border: 1px solid rgba(230,126,34,0.25); padding: 0.5rem 1rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; color: #f5b878; backdrop-filter: blur(4px); }
.kakao-banner { display: inline-block; margin-top: 1.5rem; background: #fee500; color: #191919; padding: 0.75rem 1.5rem; border-radius: 999px; font-size: 0.95rem; font-weight: 800; text-decoration: none; box-shadow: 0 4px 15px rgba(254, 229, 0, 0.2); transition: all 0.2s; position: relative; z-index: 10; }
.kakao-banner:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(254, 229, 0, 0.4); }

/* --- Container / Section --- */
.container { max-width: 1280px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
.section-title { font-size: 1.5rem; font-weight: 800; color: #f1f5f9; }
.filter-select { padding: 0.5rem 1rem; border: 1px solid #3a3d45; border-radius: 8px; font-size: 0.9rem; cursor: pointer; background: #1a1d25; color: #e2e8f0; }

/* --- Loading --- */
.loading { text-align: center; padding: 4rem; color: #8a8070; }
.spinner { width: 40px; height: 40px; border: 4px solid #2a2d35; border-top-color: #e67e22; border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 1rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Product Grid --- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.5rem; }
.product-card { background: #1a1d25; border-radius: 12px; overflow: hidden; border: 1px solid #2a2d35; transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s; cursor: pointer; display: flex; flex-direction: column; }
.product-card:hover { transform: translateY(-6px); box-shadow: 0 12px 30px -4px rgba(230,126,34,0.15); border-color: #e67e22; }
.card-img-wrap { aspect-ratio: 1; overflow: hidden; background: #f5f5f5; display: flex; align-items: center; justify-content: center; padding: 0.75rem; }
.card-img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.3s; }
.product-card:hover .card-img { transform: scale(1.05); }
.card-body { padding: 1.25rem; flex-grow: 1; display: flex; flex-direction: column; }
.card-category { font-size: 0.75rem; font-weight: 600; color: #e67e22; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.25rem; }
.card-title { font-weight: 700; font-size: 1rem; color: #f1f5f9; line-height: 1.4; margin-bottom: 0.75rem; display: -webkit-box; line-clamp: 2; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-price-row { display: flex; align-items: baseline; gap: 0.5rem; margin-top: auto; }
.card-price { font-weight: 900; font-size: 1.25rem; color: #f59e0b; }
.card-price-usd { font-size: 0.8rem; color: #94a3b8; }
.card-add-btn { width: 100%; margin-top: 1rem; padding: 0.7rem; background: linear-gradient(135deg, #e67e22, #d97706); color: #fff; border: none; border-radius: 8px; font-weight: 700; font-size: 0.9rem; cursor: pointer; transition: all 0.2s; }
.card-add-btn:hover { background: linear-gradient(135deg, #d97706, #b45309); box-shadow: 0 4px 15px rgba(230,126,34,0.3); }

/* --- Cart Sidebar --- */
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 999; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.cart-sidebar { position: fixed; right: -420px; top: 0; bottom: 0; width: 100%; max-width: 420px; background: #1a1d25; z-index: 1000; box-shadow: -4px 0 25px rgba(0,0,0,0.3); transition: right 0.3s; display: flex; flex-direction: column; }
body.cart-open .cart-overlay { opacity: 1; pointer-events: auto; }
body.cart-open .cart-sidebar { right: 0; }
.cart-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid #2a2d35; display: flex; justify-content: space-between; align-items: center; }
.cart-header h2 { font-size: 1.2rem; color: #f1f5f9; }
.close-btn { background: none; border: none; font-size: 1.8rem; cursor: pointer; color: #6b7280; line-height: 1; }
.cart-items { flex-grow: 1; overflow-y: auto; padding: 1rem 1.5rem; }
.cart-empty { text-align: center; padding: 4rem 0; color: #6b7280; }
.cart-item { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid #252830; }
.cart-item-img { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.cart-item-info { flex-grow: 1; }
.cart-item-name { font-weight: 600; font-size: 0.9rem; line-height: 1.3; margin-bottom: 0.25rem; display: -webkit-box; line-clamp: 2; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: #e2e8f0; }
.cart-item-price { font-weight: 700; color: #f59e0b; }
.cart-item-controls { display: flex; justify-content: space-between; align-items: center; margin-top: 0.5rem; }
.qty-wrap { display: flex; align-items: center; gap: 0.5rem; background: #252830; border-radius: 6px; padding: 0.15rem; }
.qty-btn { background: none; border: none; width: 28px; height: 28px; cursor: pointer; font-weight: bold; color: #94a3b8; border-radius: 4px; transition: background 0.15s; }
.qty-btn:hover { background: #3a3d45; }
.qty-val { font-weight: 600; font-size: 0.9rem; width: 24px; text-align: center; color: #e2e8f0; }
.cart-remove { color: #ef4444; font-size: 0.8rem; background: none; border: none; cursor: pointer; font-weight: 500; }
.cart-footer { padding: 1.25rem 1.5rem; border-top: 1px solid #2a2d35; background: #151720; }
.cart-summary { margin-bottom: 1rem; }
.summary-row { display: flex; justify-content: space-between; padding: 0.3rem 0; font-size: 0.9rem; color: #94a3b8; }
.summary-row.total { font-size: 1.15rem; font-weight: 800; color: #f59e0b; border-top: 1px solid #2a2d35; padding-top: 0.75rem; margin-top: 0.5rem; }
.checkout-btn { display: block; width: 100%; text-align: center; padding: 1rem; background: linear-gradient(135deg, #e67e22, #d97706); color: #fff; border: none; border-radius: 10px; font-weight: 700; font-size: 1.05rem; text-decoration: none; cursor: pointer; transition: all 0.2s; }
.checkout-btn:hover { background: linear-gradient(135deg, #d97706, #b45309); box-shadow: 0 4px 15px rgba(230,126,34,0.3); }

/* --- Product Modal --- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 2000; opacity: 0; pointer-events: none; transition: opacity 0.3s; display: flex; align-items: center; justify-content: center; padding: 2rem; }
body.modal-open .modal-overlay { opacity: 1; pointer-events: auto; }
.modal-content { background: #1a1d25; width: 100%; max-width: 900px; max-height: 90vh; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; position: relative; transform: translateY(20px) scale(0.98); transition: transform 0.3s; border: 1px solid #2a2d35; }
body.modal-open .modal-content { transform: translateY(0) scale(1); }
.modal-close { position: absolute; top: 1rem; right: 1rem; background: rgba(0,0,0,0.6); color: #fff; border: none; width: 36px; height: 36px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; z-index: 10; transition: background 0.2s; }
.modal-close:hover { background: rgba(230,126,34,0.5); }
.modal-body { display: grid; grid-template-columns: 1fr 1fr; overflow-y: auto; }
.modal-gallery { background: #0f1015; display: flex; flex-direction: column; gap: 0.5rem; padding: 1rem; align-items: center; }
.modal-gallery img { width: 100%; border-radius: 8px; object-fit: cover; }
.modal-info { padding: 2rem; display: flex; flex-direction: column; gap: 1rem; }
.modal-title { font-size: 1.4rem; font-weight: 800; line-height: 1.3; color: #f1f5f9; }
.modal-price { font-size: 1.6rem; font-weight: 900; color: #f59e0b; }
.modal-desc { font-size: 0.95rem; color: #94a3b8; line-height: 1.7; max-height: 300px; overflow-y: auto; }
.modal-actions { display: flex; gap: 0.75rem; margin-top: auto; }
.btn-primary { flex: 1; padding: 1rem; background: linear-gradient(135deg, #e67e22, #d97706); color: #fff; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 1rem; transition: all 0.2s; }
.btn-primary:hover { background: linear-gradient(135deg, #d97706, #b45309); }
.btn-secondary { flex: 1; padding: 1rem; background: #252830; color: #f1f5f9; border: 1px solid #3a3d45; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 1rem; text-decoration: none; text-align: center; transition: all 0.2s; }
.btn-secondary:hover { border-color: #e67e22; color: #e67e22; }

/* --- Auth Modal --- */
.auth-modal { background: #1a1d25; padding: 2.5rem; border-radius: 16px; max-width: 400px; width: 90%; text-align: center; position: relative; border: 1px solid #2a2d35; }
body.auth-open #authModalOverlay { opacity: 1; pointer-events: auto; }
.auth-desc { color: #94a3b8; margin: 0.5rem 0 1.5rem; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 0.75rem; width: 100%; padding: 0.9rem; background: #252830; border: 2px solid #3a3d45; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 1rem; transition: all 0.2s; color: #e2e8f0; }
.google-btn:hover { border-color: #e67e22; box-shadow: 0 2px 8px rgba(230,126,34,0.2); }
.auth-logged-in { margin-top: 1.5rem; color: #e2e8f0; }
.auth-links { display: flex; gap: 1rem; justify-content: center; margin-top: 1rem; }
.auth-links a { color: #e67e22; text-decoration: none; font-weight: 600; }
.auth-logout { background: none; border: none; color: #ef4444; cursor: pointer; font-weight: 600; }

/* --- Footer --- */
.site-footer { background: #0f1015; color: #6b7280; padding: 3rem 2rem; margin-top: 4rem; border-top: 1px solid #2a2d35; }
.footer-inner { max-width: 1280px; margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 2rem; }
.footer-brand p { margin-top: 0.5rem; font-size: 0.85rem; }
.footer-brand strong { color: #e67e22; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: #6b7280; text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.footer-links a:hover { color: #e67e22; }
.footer-info { font-size: 0.8rem; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero-title { font-size: 1.8rem; }
    .hero-subtitle { font-size: 0.95rem; }
    .hero { padding: 3rem 1.5rem; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .card-body { padding: 0.75rem; }
    .card-title { font-size: 0.85rem; }
    .card-price { font-size: 1rem; }
    .card-add-btn { font-size: 0.8rem; padding: 0.5rem; }
    .modal-body { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; }
}
