/* ==========================================================================
   LEGION LIQUOR STORE CATALOG - FRENCH MEDIEVAL THEME
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=UnifrakturMaguntia&display=swap');

:root {
  --bg-dark: #1A0306;
  --bg-card: #27060B;
  --bg-card-hover: #36090F;
  --parchment: #F8F3E6;
  --parchment-dark: #EAE1CB;
  --gold-primary: #D4AF37;
  --gold-light: #FFF0A5;
  --gold-dark: #8B6508;
  --gold-gradient: linear-gradient(135deg, #B8860B 0%, #FFD700 50%, #8B6508 100%);
  --burgundy-gradient: linear-gradient(180deg, #4A0E17 0%, #200408 100%);
  --text-light: #F8F3E6;
  --text-muted: #D1B894;
  --text-dark: #2C0C10;
  --border-gold: rgba(212, 175, 55, 0.4);
  --shadow-gold: 0 10px 30px rgba(212, 175, 55, 0.15);
  --shadow-card: 0 15px 35px rgba(0, 0, 0, 0.6);
  --font-gothic: 'UnifrakturMaguntia', 'Cinzel', serif;
  --font-heading: 'Cinzel', 'Times New Roman', serif;
  --font-body: 'Cormorant Garamond', 'Georgia', serif;
  --radius: 8px;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Base Reset & Typography */
html {
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 50% 0%, #3B0A11 0%, #1A0306 70%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 30L15 15M30 30L45 15M30 30L15 45M30 30L45 45' stroke='%233B0A11' stroke-width='0.5' fill='none' opacity='0.3'/%3E%3C/svg%3E");
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--gold-primary);
  text-decoration: none;
  transition: var(--transition);
}

button {
  cursor: pointer;
  font-family: var(--font-heading);
  border: none;
  outline: none;
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Medieval Header */
.medieval-header {
  background: var(--burgundy-gradient);
  border-bottom: 3px solid var(--gold-primary);
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.8);
  position: relative;
  z-index: 100;
}

.header-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--border-gold);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-logo {
  width: 75px;
  height: 75px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.4));
  transition: var(--transition);
}

.brand-logo:hover {
  transform: scale(1.05) rotate(-2deg);
}

.brand-titles h1 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  letter-spacing: 4px;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
  line-height: 1.1;
}

.brand-titles p {
  font-size: 1rem;
  color: var(--text-muted);
  font-style: italic;
  letter-spacing: 1px;
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--gold-primary);
  border-radius: 30px;
  padding: 4px;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.lang-btn {
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 20px;
  transition: var(--transition);
}

.lang-btn.active, .lang-btn:hover {
  background: var(--gold-gradient);
  color: var(--text-dark);
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.5);
}

/* Navigation Bar */
.main-nav {
  display: flex;
  justify-content: center;
  padding: 12px 0;
  gap: 15px;
  flex-wrap: wrap;
}

.nav-tab {
  background: rgba(42, 8, 14, 0.8);
  color: var(--text-light);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  letter-spacing: 1.5px;
  padding: 10px 24px;
  border: 1px solid var(--border-gold);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.nav-tab::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: var(--gold-gradient);
  opacity: 0;
  transition: var(--transition);
}

.nav-tab:hover, .nav-tab.active {
  background: #4A0E17;
  color: var(--gold-light);
  border-color: var(--gold-primary);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

.nav-tab.active::before {
  opacity: 1;
}

/* Grape Ornament Hero Banner */
.hero-banner {
  background: url('../images/grape_banner.png') center/cover no-repeat;
  position: relative;
  padding: 60px 0;
  text-align: center;
  border-bottom: 2px solid var(--gold-primary);
}

.hero-banner::before {
  content: '';
  position: absolute;
  top:0; left:0; right:0; bottom:0;
  background: linear-gradient(180deg, rgba(26, 3, 6, 0.85) 0%, rgba(39, 6, 11, 0.75) 50%, rgba(26, 3, 6, 0.9) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  color: var(--gold-light);
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.9);
  margin-bottom: 10px;
}

.hero-subtitle {
  font-size: 1.3rem;
  color: var(--text-muted);
  font-style: italic;
}

.ornament-divider {
  margin: 20px auto;
  max-width: 600px;
  width: 100%;
  display: block;
  overflow: hidden;
}

/* Search Bar Section */
.search-section {
  padding: 30px 0 10px;
}

.search-box {
  max-width: 650px;
  margin: 0 auto;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 14px 20px 14px 50px;
  background: rgba(39, 6, 11, 0.9);
  border: 2px solid var(--gold-primary);
  border-radius: 30px;
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 1.1rem;
  outline: none;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.8), 0 0 15px rgba(212, 175, 55, 0.1);
  transition: var(--transition);
}

.search-input:focus {
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.8), 0 0 25px rgba(212, 175, 55, 0.4);
  border-color: var(--gold-light);
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-primary);
  font-size: 1.2rem;
}

/* Filter Badges & Controls */
.filter-controls {
  padding: 20px 0 30px;
}

.filter-group {
  margin-bottom: 20px;
  text-align: center;
}

.filter-label {
  font-family: var(--font-heading);
  color: var(--gold-primary);
  font-size: 1.1rem;
  margin-bottom: 12px;
  display: block;
}

.badge-wrapper {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.badge-btn {
  background: rgba(39, 6, 11, 0.7);
  color: var(--text-muted);
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 1rem;
  font-family: var(--font-body);
  transition: var(--transition);
}

.badge-btn:hover, .badge-btn.active {
  background: var(--gold-gradient);
  color: var(--text-dark);
  border-color: var(--gold-light);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

/* Section Titles */
.section-header {
  text-align: center;
  margin: 40px 0 30px;
  position: relative;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  color: var(--gold-light);
  display: inline-block;
  position: relative;
  padding: 0 20px;
}

/* Catalog Product Grid */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  padding-bottom: 60px;
}

/* Product Card - Editable HTML Container */
.product-card {
  background: var(--bg-card);
  border: 2px solid var(--border-gold);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  position: relative;
  transition: var(--transition);
}

.product-card:hover {
  transform: translateY(-8px);
  border-color: var(--gold-primary);
  box-shadow: 0 15px 35px rgba(212, 175, 55, 0.25);
  background: var(--bg-card-hover);
}

/* Card Header & Badges */
.card-badge-container {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  z-index: 5;
  pointer-events: none;
}

.card-badge {
  background: rgba(26, 3, 6, 0.85);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card-badge-type {
  background: var(--gold-gradient);
  color: var(--text-dark);
  font-weight: 700;
}

/* Bottle Image Area */
.card-image-wrapper {
  background: radial-gradient(circle, #3D0B12 0%, #170205 100%);
  padding: 30px 20px 20px;
  text-align: center;
  position: relative;
  border-bottom: 1px solid var(--border-gold);
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image {
  max-height: 240px;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 15px rgba(0,0,0,0.7));
  transition: var(--transition);
}

.product-card:hover .product-image {
  transform: scale(1.08) translateY(-4px);
}

/* Card Content Area */
.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--gold-light);
  margin-bottom: 8px;
  line-height: 1.2;
}

.product-desc {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 15px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Footer & Price */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 15px;
  border-top: 1px dashed var(--border-gold);
  margin-top: auto;
}

.product-price-wrapper {
  display: flex;
  flex-direction: column;
}

.price-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.product-price {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gold-primary);
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.btn-details {
  background: var(--gold-gradient);
  color: var(--text-dark);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 4px;
  transition: var(--transition);
}

.btn-details:hover {
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
  transform: scale(1.04);
}

/* Editable Helper Banner for HTML Editor */
.editable-banner {
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  padding: 12px 20px;
  margin-bottom: 25px;
  font-size: 0.95rem;
  color: var(--gold-light);
  text-align: center;
}

/* Modal Window for Product Details */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--parchment);
  color: var(--text-dark);
  border: 3px solid var(--gold-primary);
  border-radius: var(--radius);
  max-width: 750px;
  width: 100%;
  display: flex;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.9);
  position: relative;
  transform: scale(0.9);
  transition: var(--transition);
}

.modal-overlay.open .modal-card {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 15px; right: 15px;
  background: #3B0A11;
  color: var(--gold-light);
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold-primary);
  transition: var(--transition);
  z-index: 10;
}

.modal-close:hover {
  background: #5A101B;
  transform: rotate(90deg);
}

.modal-image-col {
  width: 40%;
  background: radial-gradient(circle, #3D0B12 0%, #1A0306 100%);
  padding: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-image {
  max-height: 320px;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 15px 25px rgba(0,0,0,0.8));
}

.modal-info-col {
  width: 60%;
  padding: 35px 30px;
  display: flex;
  flex-direction: column;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: #3B0A11;
  margin-bottom: 10px;
}

.modal-badge-group {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
}

.modal-badge {
  background: #3B0A11;
  color: var(--gold-light);
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 12px;
  font-family: var(--font-heading);
}

.modal-price {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: #8B0000;
  margin-bottom: 15px;
}

.modal-advantages-box {
  background: var(--parchment-dark);
  border-left: 3px solid var(--gold-dark);
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.modal-advantages-title {
  font-family: var(--font-heading);
  font-weight: 700;
  color: #3B0A11;
  margin-bottom: 5px;
  font-size: 1.05rem;
}

.modal-desc {
  font-size: 1.05rem;
  color: #444;
  line-height: 1.5;
}

/* Footer */
.medieval-footer {
  background: #110204;
  border-top: 2px solid var(--gold-primary);
  padding: 40px 0 20px;
  text-align: center;
  margin-top: 40px;
}

.footer-info {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 800px;
  margin: 0 auto 20px;
  font-style: italic;
}

.footer-copy {
  font-family: var(--font-heading);
  color: var(--gold-primary);
  font-size: 0.9rem;
}

/* Responsive Rules */
@media (max-width: 900px) {
  .hero-title { font-size: 2rem; }
  .brand-titles h1 { font-size: 1.7rem; }
  .modal-card { flex-direction: column; }
  .modal-image-col, .modal-info-col { width: 100%; }
  .modal-image-col { height: 220px; padding: 20px; }
}

@media (max-width: 600px) {
  .header-top-bar { flex-direction: column; gap: 15px; text-align: center; }
  .brand-wrapper { flex-direction: column; text-align: center; }
  .catalog-grid { grid-template-columns: 1fr; }
  .section-title { font-size: 1.75rem; }
  .hero-title { font-size: 1.75rem; }
  .hero-subtitle { font-size: 1rem; }
  .ornament-divider { max-width: 100%; }
}

/* Mobile phones (≤480px) */
@media (max-width: 480px) {
  body { font-size: 16px; }

  .container { padding: 0 12px; }

  .hero-title { font-size: 1.45rem; }
  .hero-subtitle { font-size: 0.95rem; }
  .section-title { font-size: 1.45rem; }

  .brand-logo { width: 58px; height: 58px; }
  .brand-titles h1 { font-size: 1.4rem; }
  .brand-titles p { font-size: 0.85rem; }

  .nav-tab { font-size: 0.92rem; padding: 8px 14px; }

  .filter-label { font-size: 0.95rem; }
  .badge-btn { font-size: 0.9rem; padding: 6px 14px; }

  .card-image-wrapper { height: 220px; }
  .product-title { font-size: 1.15rem; }
  .product-price { font-size: 1.15rem; }

  .modal-info-col { padding: 20px 16px; }
  .modal-title { font-size: 1.4rem; }
  .modal-price { font-size: 1.4rem; }
  .modal-desc { font-size: 0.95rem; }
}
