/* ============================================
   Qovun Sayli - Production CSS
   Pure CSS3, Mobile-first, Accessible
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  --color-white: #ffffff;
  --color-bg: #F8F7F4;
  --color-primary: #F5B53D;
  --color-primary-dark: #e0a32e;
  --color-green: #2E7D32;
  --color-green-dark: #1b5e20;
  --color-text: #1a1a1a;
  --color-text-muted: #5c5c5c;
  --color-border: #e8e6e1;
  --color-shadow: rgba(0, 0, 0, 0.06);
  --color-shadow-hover: rgba(0, 0, 0, 0.1);

  --radius: 20px;
  --radius-sm: 12px;
  --radius-full: 9999px;

  --shadow: 0 4px 20px var(--color-shadow);
  --shadow-hover: 0 8px 30px var(--color-shadow-hover);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --header-h: 72px;
  --drawer-w: 320px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ---------- Accessibility ---------- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-white);
  box-shadow: 0 1px 0 var(--color-border);
  height: var(--header-h);
}

.header__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header__logo img {
  height: 44px;
  width: auto;
}

.header__logo-text {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-green);
  letter-spacing: -0.02em;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Language switcher */
.lang-switcher {
  display: flex;
  gap: 4px;
  background: var(--color-bg);
  border-radius: var(--radius-full);
  padding: 4px;
}

.lang-btn {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  transition: all var(--transition);
  min-width: 40px;
  text-align: center;
}

.lang-btn:hover {
  color: var(--color-text);
}

.lang-btn.is-active {
  background: var(--color-primary);
  color: var(--color-white);
}

/* Hamburger */
.hamburger {
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.hamburger:hover {
  background: var(--color-bg);
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform var(--transition);
}

/* ---------- Drawer ---------- */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--drawer-w);
  max-width: 90%;
  height: 100%;
  background: var(--color-white);
  z-index: 210;
  transform: translateX(100%);
  transition: transform var(--transition);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.08);
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.drawer__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-green);
}

.drawer__close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 1.5rem;
  color: var(--color-text-muted);
  transition: background var(--transition), color var(--transition);
}

.drawer__close:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.drawer__list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary) transparent;
}

.drawer__list::-webkit-scrollbar {
  width: 6px;
}

.drawer__list::-webkit-scrollbar-track {
  background: transparent;
}

.drawer__list::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 3px;
}

.drawer__link {
  display: block;
  padding: 12px 24px;
  font-size: 0.9375rem;
  color: var(--color-text);
  transition: background var(--transition), color var(--transition);
}

.drawer__link:hover {
  background: var(--color-bg);
  color: var(--color-green);
}

/* ---------- Main ---------- */
.main {
  flex: 1;
  padding: 32px 20px 48px;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
}

/* ---------- Melon Grid (Index) ---------- */
.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-green);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.page-subtitle {
  color: var(--color-text-muted);
  margin-bottom: 32px;
  font-size: 1rem;
}

.melons-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 540px) {
  .melons-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .melons-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

@media (min-width: 1024px) {
  .melons-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Card */
.melon-card {
  background: var(--color-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.melon-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.melon-card__image-wrap {
  aspect-ratio: 4 / 3;
  background: var(--color-bg);
  overflow: hidden;
}

.melon-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.melon-card:hover .melon-card__image {
  transform: scale(1.04);
}

.melon-card__body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.melon-card__name {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.melon-card__type {
  font-size: 0.8125rem;
  color: var(--color-primary);
  font-weight: 600;
}

/* ---------- Melon Detail Page ---------- */
.detail {
  max-width: 720px;
  margin: 0 auto;
}

.detail__image-wrap {
  background: var(--color-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  aspect-ratio: 16 / 10;
}

.detail__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--color-bg);
}

.detail__name {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--color-green);
  text-align: center;
  margin-bottom: 28px;
  letter-spacing: -0.02em;
}

.detail__specs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 40px;
}

@media (min-width: 540px) {
  .detail__specs {
    grid-template-columns: repeat(3, 1fr);
  }
}

.spec-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.spec-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.spec-card__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.spec-card__value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
}

.spec-card--type .spec-card__value {
  color: var(--color-primary);
}

/* ---------- Footer ---------- */
.footer {
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  padding: 24px 20px;
  margin-top: auto;
}

@media (max-width: 640px) {
  .main {
    padding: 24px 16px 32px;
  }

  .detail {
    padding: 0 8px;
  }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .drawer {
    width: 100%;
    max-width: 100%;
  }
}

.footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer__logo img {
  height: 36px;
  width: auto;
}

.footer__link {
  font-weight: 600;
  color: var(--color-green);
  transition: color var(--transition);
}

.footer__link:hover {
  color: var(--color-primary);
}

.footer__copy {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  width: 100%;
  text-align: center;
  margin-top: 8px;
}

@media (min-width: 640px) {
  .footer__copy {
    width: auto;
    margin-top: 0;
    text-align: left;
  }
}

/* ---------- Utilities ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-green);
  margin-bottom: 24px;
  transition: color var(--transition);
}

.back-link:hover {
  color: var(--color-primary);
}
