/* ========================================
   Millésime - Neoclassic Elegant Design
   Premium Wine Store CSS
   ======================================== */

/* ========== CSS Variables & Theme ========== */
:root {
  /* Millésime Neoclassic Elegant Theme */
  /* Primary: Burgundy - Deep wine color for main accents */
  --primary: #5C2E3A;
  --primary-foreground: #F5E6D3;
  
  /* Accent: Gold - Luxury and refinement */
  --accent: #D4AF37;
  --accent-foreground: #1A1A1A;
  
  /* Secondary: Warm Beige - Sophisticated background */
  --secondary: #F5E6D3;
  --secondary-foreground: #2C2C2C;
  
  /* Muted: Light gray for subtle elements */
  --muted: #E8E0D5;
  --muted-foreground: #5C5C5C;
  
  /* Background and foreground */
  --background: #FEFDFB;
  --foreground: #1A1A1A;
  --card: #FFFFFF;
  --card-foreground: #1A1A1A;
  --border: #E8E0D5;
  --input: #F5E6D3;
  --ring: #5C2E3A;
  
  /* Spacing */
  --radius: 0.5rem;
}

.dark {
  --primary: #D4AF37;
  --primary-foreground: #1A1A1A;
  --secondary: #2C2C2C;
  --secondary-foreground: #F5E6D3;
  --muted: #3C3C3C;
  --muted-foreground: #B8B0A5;
  --accent: #D4AF37;
  --accent-foreground: #1A1A1A;
  --border: #3C3C3C;
  --input: #2C2C2C;
  --ring: #D4AF37;
  --background: #0F0F0F;
  --foreground: #F5E6D3;
  --card: #1A1A1A;
  --card-foreground: #F5E6D3;
}

/* ========== Base Styles ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border-color: var(--border);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  letter-spacing: 0.3px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
  color: var(--primary);
}

h1 {
  font-size: clamp(2.5rem, 8vw, 4rem);
}

h2 {
  font-size: clamp(2rem, 6vw, 3rem);
}

h3 {
  font-size: clamp(1.5rem, 4vw, 2rem);
}

h4 {
  font-size: 1.5rem;
}

h5 {
  font-size: 1.25rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent);
}

/* ========== Container & Layout ========== */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  max-width: 1280px;
}

@media (min-width: 640px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Flexbox utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

.gap-8 {
  gap: 2rem;
}

/* Grid utilities */
.grid {
  display: grid;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ========== Header & Navigation ========== */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--background);
  border-bottom: 1px solid var(--border);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 5rem;
  padding: 0 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--primary);
}

.logo-title {
  font-size: 1.5rem;
  font-weight: bold;
  font-family: 'Playfair Display', serif;
  letter-spacing: -0.5px;
}

.logo-subtitle {
  font-size: 0.65rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.15em;
}

nav {
  display: none;
  gap: 2rem;
}

nav.nav-open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card);
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 100;
}

@media (min-width: 768px) {
  nav {
    display: flex;
  }
}

nav a {
  color: var(--foreground);
  font-weight: 500;
  transition: color 0.3s ease;
}

nav a:hover {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--foreground);
  transition: all 0.3s ease;
  border-radius: 0;
}

.icon-btn:hover {
  background-color: var(--muted);
  color: var(--primary);
}


.cart-badge {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  width: 1.25rem;
  height: 1.25rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.75rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

/* ========== Hero Section ========== */
.hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

@media (min-width: 768px) {
  .hero {
    height: 600px;
  }
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-color: var(--primary);
}
@media (max-width: 768px) {
  .hero-bg { background-attachment: scroll; }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
}

/* ========== Header Search ========== */
.header-search {
  display: flex;
  align-items: center;
}

.header-search-input {
  width: 0;
  min-width: 0;
  padding: 0;
  border: none;
  background: var(--card);
  color: var(--foreground);
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
  transition: width 0.25s ease, padding 0.25s ease;
  height: 2.5rem;
}

.header-search-input.search-visible {
  width: 160px;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
}

.header-search-input:focus {
  border-color: var(--accent);
}

.header-search-btn {
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .header-search-input.search-visible {
    width: 120px;
  }
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 42rem;
  animation: fadeInUp 0.8s ease-out;
}

.hero-title {
  color: white;
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

.hero-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.25rem;
  margin-bottom: 2rem;
  font-weight: 300;
}

/* ========== Sections ========== */
.section {
  padding: 4rem 0;
}

@media (min-width: 768px) {
  .section {
    padding: 6rem 0;
  }
}

@media (min-width: 1024px) {
  .section {
    padding: 8rem 0;
  }
}

.section-py-sm {
  padding: 2rem 0;
}

@media (min-width: 768px) {
  .section-py-sm {
    padding: 3rem 0;
  }
}

.section-title {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title h2 {
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  max-width: 42rem;
  margin: 0 auto;
}

/* ========== Dividers ========== */
.divider-gold {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
  margin: 1.5rem auto;
  width: 6rem;
}

.divider-gold-thick {
  height: 4px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
  margin: 1.5rem auto;
  width: 6rem;
}

/* ========== Cards ========== */
.card-elegant {
  background-color: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--muted);
  border-radius: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.card-elegant:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border-color: var(--accent);
}

.card-elegant img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ========== Buttons ========== */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: 0;
  transition: all 0.3s ease;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-premium {
  padding: 0.75rem 2rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-premium:hover:not(:disabled) {
  opacity: 0.9;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.btn-premium:active:not(:disabled) {
  transform: scale(0.95);
}

.btn-premium-outline {
  padding: 0.75rem 2rem;
  border: 2px solid var(--primary);
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.05em;
  background-color: transparent;
}

.btn-premium-outline:hover:not(:disabled) {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.btn-premium-gold {
  padding: 0.75rem 2rem;
  background-color: var(--accent);
  color: var(--accent-foreground);
  font-weight: 600;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-premium-gold:hover:not(:disabled) {
  opacity: 0.9;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  color: var(--accent-foreground);
}

.btn-premium-gold:active:not(:disabled) {
  transform: scale(0.95);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* ========== Badges ========== */
.badge-elegant {
  display: inline-block;
  padding: 0.25rem 1rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  background-color: rgba(212, 175, 55, 0.1);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  border-radius: 0;
}

/* ========== Forms ========== */
input,
textarea,
select {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background-color: var(--input);
  color: var(--foreground);
  transition: all 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(92, 46, 58, 0.1);
}

input::placeholder {
  color: var(--muted-foreground);
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--foreground);
}

.form-group {
  margin-bottom: 1.5rem;
}

/* ========== Footer ========== */
footer {
  padding: 3rem 0;
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.footer-section h4 {
  color: var(--primary-foreground);
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

.footer-section p {
  font-size: 0.875rem;
  opacity: 0.9;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--primary-foreground);
  font-size: 0.875rem;
  transition: opacity 0.3s ease;
}

.footer-links a:hover {
  opacity: 0.8;
}

.footer-social {
  display: flex;
  gap: 1rem;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 0;
  transition: background-color 0.3s ease;
}

.footer-social a:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.footer-newsletter {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-newsletter-row {
  display: flex;
  gap: 0.5rem;
}

.footer-newsletter input {
  flex: 1;
  background-color: var(--primary-foreground);
  color: var(--primary);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

.footer-newsletter button {
  padding: 0.5rem 1rem;
  background-color: var(--accent);
  color: var(--accent-foreground);
  font-weight: 600;
}

.footer-divider {
  height: 1px;
  background-color: var(--primary-foreground);
  opacity: 0.2;
  margin: 2rem 0;
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.875rem;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.payment-methods {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
}

.payment-badge {
  width: 2.5rem;
  height: 1.5rem;
  background-color: var(--primary-foreground);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--primary);
}

/* ========== Animations ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes goldGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(212, 175, 55, 0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.animate-slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

.animate-gold-glow {
  animation: goldGlow 2s infinite;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .section {
    padding: 2rem 0;
  }

  .grid-cols-1 {
    grid-template-columns: 1fr;
  }
}

/* ========== Utility Classes ========== */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-left {
  text-align: left;
}

.mb-1 {
  margin-bottom: 0.25rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-6 {
  margin-bottom: 1.5rem;
}

.mb-8 {
  margin-bottom: 2rem;
}

.mt-auto {
  margin-top: auto;
}

.pt-4 {
  padding-top: 1rem;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.py-3 {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.inset-0 {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.z-10 {
  z-index: 10;
}

.z-50 {
  z-index: 50;
}

.opacity-90 {
  opacity: 0.9;
}

.opacity-80 {
  opacity: 0.8;
}

.opacity-75 {
  opacity: 0.75;
}

.opacity-50 {
  opacity: 0.5;
}

.hidden {
  display: none;
}

@media (min-width: 768px) {
  .md\:hidden {
    display: none;
  }

  .md\:flex {
    display: flex;
  }
}

/* ========== User Dropdown ========== */
.user-dropdown {
  position: relative;
}

.user-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  min-width: 180px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 100;
  padding: 0.5rem 0;
}

.user-dropdown:hover .user-dropdown-menu {
  display: block;
}

.user-dropdown-name {
  display: block;
  padding: 0.5rem 1rem;
  font-weight: 600;
  color: var(--primary);
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.user-dropdown-item {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--foreground);
  font-size: 0.875rem;
  text-decoration: none;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.2s;
}

.user-dropdown-item:hover {
  background-color: var(--muted);
  color: var(--primary);
}

/* ========== CSP Compliance ========== */
.hero-home {
    background-image: url('https://d2xsxph8kpxj0f.cloudfront.net/310519663123416043/oNXkmfyzsbDL4eZ2xjUHn9/hero-vineyard-dqfZwyX7rD42XguzQgb2zw.webp');
}

.btn-filter-clear {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #c9a84c;
    color: #c9a84c;
    text-decoration: none;
    border-radius: 4px;
}

.logout-form {
    display: block;
    width: 100%;
}

.admin-ml-sm {
    margin-left: 0.5rem;
}

/* ========== Print Styles ========== */
@media print {
  header,
  footer,
  .no-print {
    display: none;
  }
}

.newsletter-feedback {
    display: block; font-size: 0.8rem; margin-top: 0.5rem;
}
.newsletter-success { color: #22c55e; }
.newsletter-error { color: #ef4444; }
