* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; width: 100%; min-height: 100%; overflow-x: hidden; background: #F8F6F2; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { display: flex; justify-content: center; align-items: flex-start; }
img { max-width: 100%; display: block; }
button { font-family: inherit; -webkit-tap-highlight-color: transparent; }

#velvastra-app { width: 100%; max-width: 500px; min-height: 100vh; margin: 0 auto; background: #F8F6F2; position: relative; overflow-x: hidden; padding-bottom: 80px; }

#main-directory { padding: 15px; }
#main-directory.hidden { display: none; }

.hero-banner { background: #1a1a1a; padding: 20px; border-radius: 12px; margin-bottom: 25px; text-align: center; box-shadow: 0 8px 20px rgba(0,0,0,0.15); border-bottom: 4px solid #d4af37; }
.hero-banner h1 { margin: 0; color: #d4af37; font-size: 28px; letter-spacing: 2px; text-transform: uppercase; }
.hero-banner p { margin: 5px 0 0; color: #fff; font-size: 14px; font-style: italic; letter-spacing: 1px; }

.shop-card { background-size: cover; background-position: center; height: 140px; border-radius: 12px; margin-bottom: 18px; display: flex; align-items: flex-end; padding: 15px; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.15); position: relative; overflow: hidden; }
.shop-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.8)); border-radius: 12px; }
.shop-card h3 { color: #fff; margin: 0; font-size: 20px; text-shadow: 1px 1px 3px rgba(0,0,0,0.8); position: relative; z-index: 1; }

#store-view { display: none; background: #f8f9fa; min-height: 100vh; }
.store-header { background: #1a1a1a; padding: 15px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 5px rgba(0,0,0,0.2); position: sticky; top: 0; z-index: 10; }
.store-header button { background: none; border: none; font-size: 16px; font-weight: bold; color: #d4af37; cursor: pointer; display: flex; align-items: center; gap: 5px; }
.store-header span { color: #fff; font-weight: bold; letter-spacing: 1px; font-size: 14px; }

.store-hero { height: 180px; background-size: cover; background-position: center; position: relative; }
.store-hero .overlay { position: absolute; bottom: 0; left: 0; width: 100%; background: linear-gradient(transparent, rgba(0,0,0,0.9)); padding: 15px; }
.store-hero h2 { margin: 0; color: #fff; font-size: 24px; }

.tabs { display: flex; background: #fff; border-bottom: 2px solid #eee; }
.tab-btn { flex: 1; padding: 15px; background: none; border: none; border-bottom: 3px solid transparent; font-weight: bold; color: #888; cursor: pointer; }
.tab-btn.active { border-bottom: 3px solid #1a1a1a; color: #1a1a1a; }

.tab-content { padding: 15px; }
.tab-content.hidden { display: none; }

.offer-card { display: flex; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,0.06); border-left: 4px solid #C8A96B; margin-bottom: 14px; }
.offer-card img { width: 105px; height: 110px; object-fit: cover; }
.offer-card .info { padding: 12px; display: flex; flex-direction: column; justify-content: center; }
.offer-card h4 { margin: 0 0 5px 0; color: #1F2937; font-size: 15px; }
.offer-card p { margin: 0; font-size: 13px; color: #6B7280; }
.offer-card .tag { margin-top: 8px; background: #F8F1E1; color: #8A6A2F; padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: bold; width: fit-content; }

.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.product-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.product-card img { width: 100%; height: 145px; object-fit: cover; }
.product-card .info { padding: 10px; }
.product-card h4 { margin: 0; font-size: 14px; color: #1F2937; }
.product-card p { margin: 3px 0 0; font-weight: bold; color: #C8A96B; }

#openAdminBtn { position: fixed; bottom: 20px; left: 20px; background: #1a1a1a; color: #d4af37; padding: 12px 18px; border: 2px solid #d4af37; border-radius: 8px; cursor: pointer; z-index: 1000; font-weight: bold; box-shadow: 0 6px 12px rgba(0,0,0,0.4); font-size: 14px; }

#adminModal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 1001; justify-content: center; align-items: center; }
.admin-panel { background: #fff; padding: 30px; border-radius: 12px; width: 90%; max-width: 400px; box-shadow: 0 10px 25px rgba(0,0,0,0.5); }
.admin-header { text-align: center; margin-bottom: 20px; }
.admin-header h2 { margin: 0; color: #1a1a1a; font-size: 22px; }
.admin-header p { color: #666; font-size: 14px; margin-top: 5px; }

#loginForm input, #redeemForm input { width: 100%; padding: 12px; margin-bottom: 12px; border: 2px solid #ddd; border-radius: 6px; font-size: 15px; box-sizing: border-box; }
#loginForm button, #redeemForm button { background: #1a1a1a; color: #d4af37; padding: 14px; border: none; border-radius: 6px; width: 100%; cursor: pointer; font-size: 16px; font-weight: bold; text-transform: uppercase; }
#adminResults { display: none; margin-top: 16px; background: #f8f9fa; padding: 15px; border-radius: 8px; border-left: 5px solid #2ecc71; }
#adminResults.error { border-left-color: #e74c3c; }
.link-btn { background: transparent; border: none; color: #888; cursor: pointer; text-decoration: underline; font-size: 14px; }

@media (max-width: 480px) {
  .product-card img { height: 135px; }
  .offer-card img { width: 96px; height: 104px; }
}
@media (max-width: 360px) {
  .product-grid { grid-template-columns: 1fr; }
  .product-card img { height: 180px; }
}
