/* =====================================================================
   ShopMarket - Pazarama.com tarzı e-ticaret arayüzü
   Bağımlılık yok (framework/CDN gerektirmez) - paylaşımlı hosting dostu.
   ===================================================================== */

:root {
  --brand: #ff6600;
  --brand-dark: #e65500;
  --brand-light: #fff3ea;
  --accent: #2563eb;
  --text: #1c1c1c;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f5f6f8;
  --white: #ffffff;
  --success: #16a34a;
  --danger: #dc2626;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(0,0,0,.06);
  --shadow-hover: 0 6px 20px rgba(0,0,0,.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}
body.rtl { direction: rtl; text-align: right; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--text-muted); font-size: .9rem; }

/* ---------- Buttons / forms ---------- */
.btn {
  display: inline-block;
  padding: .65rem 1.4rem;
  border-radius: var(--radius);
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-size: .95rem;
  transition: transform .1s ease, box-shadow .1s ease, background .15s ease;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--white); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #f0f0f0; }
.btn-link { background: transparent; color: var(--brand); }
.btn-block { display: block; width: 100%; text-align: center; margin-top: .5rem; }
.btn-sm { padding: .4rem .9rem; font-size: .85rem; }
.btn-xs { padding: .25rem .6rem; font-size: .75rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link-danger { background: none; border: none; color: var(--danger); cursor: pointer; padding: 0; font: inherit; }

label { display: block; margin-bottom: .9rem; font-weight: 600; font-size: .9rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], select, textarea {
  width: 100%; margin-top: .35rem; padding: .6rem .75rem; border: 1px solid var(--border);
  border-radius: 8px; font-size: .95rem; font-family: inherit; font-weight: 400; background: #fff;
}
textarea { resize: vertical; }
.checkbox-label { display: flex; align-items: center; gap: .5rem; }
.checkbox-label input { width: auto; margin: 0; }

.alert { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .9rem; }
.alert-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }

/* ---------- Topbar ---------- */
.topbar { background: #222; color: #ddd; font-size: .82rem; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; padding: 6px 16px; gap: 1rem; flex-wrap: wrap; }
.topbar-switchers { display: flex; gap: .5rem; }
.topbar-switchers select { background: #333; color: #fff; border: none; padding: 3px 6px; border-radius: 4px; font-size: .8rem; width: auto; margin: 0; }

/* ---------- Header ---------- */
.site-header { background: var(--white); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 1.5rem; padding: 14px 16px; flex-wrap: wrap; }
.logo { font-size: 1.6rem; font-weight: 800; color: var(--brand); flex-shrink: 0; }
.search-bar { flex: 1; min-width: 200px; display: flex; }
.search-bar input { border-radius: 8px 0 0 8px; margin: 0; border-right: none; }
.search-bar button { border: 1px solid var(--brand); background: var(--brand); color: #fff; border-radius: 0 8px 8px 0; padding: 0 1.1rem; cursor: pointer; }
.header-actions { display: flex; gap: 1.3rem; flex-shrink: 0; }
.header-link { display: flex; flex-direction: column; align-items: center; font-size: .78rem; font-weight: 600; position: relative; }
.header-link .icon { font-size: 1.3rem; }
.cart-link .cart-count {
  position: absolute; top: -6px; right: -10px; background: var(--brand); color: #fff;
  border-radius: 50%; width: 18px; height: 18px; font-size: .68rem; display: flex; align-items: center; justify-content: center;
}
.category-nav { background: var(--brand); }
.category-nav-inner { display: flex; gap: 1.6rem; padding: 10px 16px; overflow-x: auto; }
.category-nav-inner a { color: #fff; font-size: .88rem; font-weight: 600; white-space: nowrap; }
.category-nav-inner a:hover { text-decoration: underline; }

/* ---------- Hero slider ---------- */
.hero-slider { position: relative; max-width: 1280px; margin: 16px auto; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.hero-track { position: relative; aspect-ratio: 16 / 5; background: #eee; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease; }
.hero-slide.active { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.hero-dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.hero-dot { width: 9px; height: 9px; border-radius: 50%; border: none; background: rgba(255,255,255,.6); cursor: pointer; }
.hero-dot.active { background: #fff; }

/* ---------- Sections ---------- */
.section { margin: 2rem auto; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.section-title { font-size: 1.3rem; font-weight: 800; margin: 0 0 1rem; border-left: 5px solid var(--brand); padding-left: .6rem; }

.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 1rem; }
.category-tile { background: var(--white); border-radius: var(--radius); padding: 1rem .5rem; text-align: center; box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; }
.category-tile:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.category-tile-icon { width: 46px; height: 46px; margin: 0 auto .5rem; background: var(--brand-light); color: var(--brand); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.2rem; }
.category-tile span { font-size: .82rem; font-weight: 600; }

.campaign-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.campaign-card { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s; }
.campaign-card:hover { transform: translateY(-3px); }
.campaign-card img { aspect-ratio: 1 / 1; object-fit: cover; }

.banner-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.banner-grid-item { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.banner-grid-item img { aspect-ratio: 2 / 1; object-fit: cover; }

/* ---------- Product grid / cards ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.product-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; display: flex; flex-direction: column; }
.product-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.product-card-image { position: relative; aspect-ratio: 1 / 1; background: #f2f2f2; }
.product-card-image img { width: 100%; height: 100%; object-fit: cover; }
.badge-discount { position: absolute; top: 8px; left: 8px; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.product-card-body { padding: .8rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.product-card-brand { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; font-weight: 700; }
.product-card-name { font-size: .88rem; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4em; }
.product-card-prices { display: flex; align-items: baseline; gap: .5rem; margin-top: auto; }
.price-current { color: var(--brand); font-weight: 800; font-size: 1.05rem; }
.price-large { font-size: 1.6rem; }
.price-compare { text-decoration: line-through; color: var(--text-muted); font-size: .82rem; }
.add-to-cart-form { margin-top: .4rem; display: flex; gap: .4rem; }
.add-to-cart-form .qty-input { width: 60px; margin: 0; }
.add-to-cart-form button { flex: 1; }

/* ---------- Category / breadcrumbs ---------- */
.breadcrumbs { padding: 1rem 0 0; font-size: .82rem; color: var(--text-muted); }
.breadcrumbs a { color: var(--accent); }
.category-page-header { display: flex; justify-content: space-between; align-items: center; margin: 1rem 0; flex-wrap: wrap; gap: .5rem; }
.sort-form select { margin: 0; width: auto; }
.pagination { display: flex; gap: .4rem; margin: 1.5rem 0; }
.pagination a { padding: .4rem .8rem; border-radius: 6px; background: var(--white); box-shadow: var(--shadow); font-weight: 600; font-size: .85rem; }
.pagination a.active { background: var(--brand); color: #fff; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); font-size: 1.05rem; }

/* ---------- Product detail ---------- */
.product-detail { display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: 2rem; margin: 1.5rem 0; }
.product-detail-image { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; }
.product-detail-image img { aspect-ratio: 1/1; object-fit: contain; }
.product-detail-info h1 { font-size: 1.5rem; margin: .3rem 0; }
.product-short-desc { color: var(--text-muted); }
.product-detail-prices { display: flex; align-items: baseline; gap: 1rem; margin: .8rem 0; }
.stock-info { font-weight: 700; font-size: .85rem; }
.stock-info.in-stock { color: var(--success); }
.stock-info.out-stock { color: var(--danger); }
.product-meta { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; margin-top: 1.5rem; font-size: .88rem; }
.product-meta dt { color: var(--text-muted); }
.product-description { background: var(--white); padding: 1.2rem; border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- Cart ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; align-items: start; margin: 1.5rem 0; }
.cart-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cart-table th, .cart-table td { padding: .8rem; border-bottom: 1px solid var(--border); text-align: left; font-size: .88rem; }
body.rtl .cart-table th, body.rtl .cart-table td { text-align: right; }
.cart-product-cell { display: flex; align-items: center; gap: .7rem; }
.cart-product-cell img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
.qty-form input { width: 60px; margin: 0; }
.cart-summary { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem; position: sticky; top: 90px; }
.summary-row { display: flex; justify-content: space-between; font-size: .9rem; padding: .35rem 0; }
.summary-total { font-weight: 800; font-size: 1.1rem; border-top: 1px solid var(--border); margin-top: .5rem; padding-top: .7rem; }
.free-shipping-note { font-size: .78rem; color: var(--text-muted); }

/* ---------- Checkout ---------- */
.checkout-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; margin: 1.5rem 0; align-items: start; }
.checkout-form { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; }
.checkout-form h2 { font-size: 1.05rem; margin-top: 1.4rem; }
.secure-note { font-size: .8rem; color: var(--text-muted); }
.order-result { text-align: center; padding: 4rem 1rem; }
.result-icon { width: 70px; height: 70px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; margin: 0 auto 1rem; color: #fff; }
.result-icon.success { background: var(--success); }
.result-icon.failed { background: var(--danger); }
.checkout-embed { margin: 2rem auto; max-width: 600px; }

/* ---------- Auth / account ---------- */
.auth-page { max-width: 420px; margin: 3rem auto; }
.auth-form { background: var(--white); padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.account-page-header { display: flex; justify-content: space-between; align-items: center; margin: 1.5rem 0; }
.orders-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.orders-table th, .orders-table td { padding: .7rem; border-bottom: 1px solid var(--border); font-size: .88rem; text-align: left; }

.status-badge { padding: 2px 9px; border-radius: 20px; font-size: .74rem; font-weight: 700; text-transform: capitalize; }
.status-pending { background: #fef9c3; color: #854d0e; }
.status-paid { background: #dcfce7; color: #166534; }
.status-failed, .status-cancelled { background: #fee2e2; color: #991b1b; }
.status-shipped { background: #dbeafe; color: #1e40af; }

/* ---------- Footer ---------- */
.site-footer { background: #1a1a1a; color: #ccc; margin-top: 3rem; padding: 2.5rem 0 0; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 2rem; }
.footer-col h4 { color: #fff; margin-bottom: .8rem; font-size: .95rem; }
.footer-col ul li { margin-bottom: .4rem; font-size: .85rem; }
.footer-col a:hover { color: var(--brand); }
.footer-bottom { text-align: center; padding: 1.2rem 16px; margin-top: 2rem; border-top: 1px solid #333; font-size: .8rem; color: #888; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .product-detail { grid-template-columns: 1fr; }
  .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
}
@media (max-width: 600px) {
  .header-inner { flex-direction: row; }
  .logo { font-size: 1.2rem; }
  .hero-track { aspect-ratio: 4 / 3; }
}
