/* ==========================================================================
   Creazioni Lopez - Stylesheet
   ========================================================================== */

/* Cascade Layers Definition */
@layer reset, tokens, base, components, utilities;

@layer reset {
  *, *::before, *::after {
    box-sizing: border-box;
  }

  body, h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd {
    margin: 0;
    padding: 0;
  }

  ul[class], ol[class] {
    list-style: none;
  }

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

  body {
    min-height: 100vh;
    text-rendering: optimizeSpeed;
    line-height: 1.5;
  }

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

  input, button, textarea, select {
    font: inherit;
  }

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

  button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
  }
}

@layer tokens {
  :root {
    /* Color Palette - HSL (Harmonious & Tailored) */
    --hue-wood: 28; /* Walnut/Oak warm orange-brown */
    --hue-resin: 345; /* Dusty Rose / Rosa antico theme */
    
    /* Literal Design Tokens (Tier 1) */
    --color-wood-light: hsl(var(--hue-wood), 35%, 50%);
    --color-wood-main: hsl(var(--hue-wood), 45%, 35%);
    --color-wood-dark: hsl(var(--hue-wood), 50%, 15%);
    
    --color-resin-light: hsl(var(--hue-resin), 55%, 60%);
    --color-resin-main: hsl(var(--hue-resin), 45%, 48%);
    --color-resin-dark: hsl(var(--hue-resin), 50%, 25%);
    --color-resin-glow: hsl(var(--hue-resin), 75%, 68%);

    --color-gold: hsl(45, 80%, 55%);
    
    /* Typography Tokens */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Spacing (Fluid sizing using clamp) */
    --space-xs: clamp(0.5rem, 0.4rem + 0.5vw, 0.75rem);
    --space-sm: clamp(0.75rem, 0.6rem + 0.75vw, 1.125rem);
    --space-md: clamp(1.25rem, 1rem + 1.25vw, 1.875rem);
    --space-lg: clamp(2rem, 1.6rem + 2vw, 3rem);
    --space-xl: clamp(3.5rem, 2.8rem + 3.5vw, 5.25rem);
    
    /* Border Radius & Visuals */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 9999px;
    
    /* Native color-scheme support for automatic dark-mode rendering */
    color-scheme: light dark;
    
    /* Semantic theme assignments via light-dark() */
    --bg-primary: light-dark(hsl(0, 0%, 98%), hsl(var(--hue-resin), 15%, 8%));
    --bg-secondary: light-dark(hsl(var(--hue-wood), 20%, 95%), hsl(var(--hue-resin), 15%, 11%));
    --bg-card: light-dark(hsl(0, 0%, 100%), hsl(var(--hue-resin), 12%, 14%));
    
    --text-primary: light-dark(hsl(var(--hue-wood), 40%, 12%), hsl(0, 0%, 94%));
    --text-secondary: light-dark(hsl(var(--hue-wood), 20%, 35%), hsl(var(--hue-resin), 8%, 70%));
    --text-accent: light-dark(var(--color-resin-main), var(--color-resin-glow));
    
    --border-color: light-dark(hsl(var(--hue-wood), 15%, 88%), hsl(var(--hue-resin), 12%, 22%));
    --border-color-focus: light-dark(var(--color-wood-light), var(--color-resin-light));
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
    
    --glass-bg: light-dark(rgba(255, 255, 255, 0.75), rgba(28, 16, 18, 0.75));
    --glass-border: light-dark(rgba(220, 210, 200, 0.4), rgba(100, 65, 70, 0.3));
    --glass-blur: 16px;
  }
}

@view-transition {
  navigation: auto; /* Enable native smooth cross-document view transitions */
}

@layer base {
  html {
    scroll-padding-top: 80px; /* Header spacing offset for smooth scrolling */
    scrollbar-color: var(--color-resin-main) var(--bg-secondary);
    scrollbar-width: thin;
  }

  body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
    
    /* Page entrance animation */
    animation: page-enter 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }

  @keyframes page-enter {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    color: light-dark(var(--color-wood-dark), #fff);
  }

  h1 {
    font-size: clamp(2.5rem, 2rem + 2.5vw, 4rem);
    font-weight: 800;
  }

  h2 {
    font-size: clamp(1.8rem, 1.5rem + 1.5vw, 2.5rem);
    font-weight: 700;
  }

  h3 {
    font-size: clamp(1.3rem, 1.2rem + 0.8vw, 1.75rem);
  }

  strong {
    color: light-dark(var(--color-wood-main), var(--color-resin-glow));
    font-weight: 600;
  }

  /* Custom Focus Ring using :focus-visible */
  :focus-visible {
    outline: 2px solid var(--border-color-focus);
    outline-offset: 4px;
  }

  /* Legacy scrollbar support for Webkit */
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  ::-webkit-scrollbar-track {
    background: var(--bg-secondary);
  }
  ::-webkit-scrollbar-thumb {
    background: var(--color-resin-main);
    border-radius: var(--radius-pill);
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--color-resin-light);
  }
}

@layer components {
  /* CONTAINER */
  .container {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: var(--space-md);
  }

  /* BUTTONS */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 0.8rem 1.6rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
  }

  .btn-primary {
    background: linear-gradient(135deg, var(--color-resin-main), var(--color-resin-light), var(--color-resin-glow));
    background-size: 200% auto;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 168, 150, 0.3);
    transition: background-position 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease, box-shadow 0.3s ease;
  }

  .btn-primary:hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 168, 150, 0.45);
  }

  .btn-secondary {
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    background-color: transparent;
  }

  .btn-secondary:hover {
    border-color: var(--border-color-focus);
    background-color: var(--bg-secondary);
    transform: translateY(-2px);
  }

  .btn-block {
    display: flex;
    width: 100%;
  }

  .btn-social-instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(220, 39, 67, 0.25);
  }

  .btn-social-instagram:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(220, 39, 67, 0.4);
  }

  .btn-social-facebook {
    background-color: #1877f2;
    color: #fff;
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.25);
  }

  .btn-social-facebook:hover {
    background-color: #166fe5;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(24, 119, 242, 0.4);
  }

  .btn-social-instagram svg, .btn-social-facebook svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.2px;
  }

  /* HEADER & NAVIGATION */
  .main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    z-index: 1000;
    background-color: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.3s ease;
  }

  .main-header.scrolled {
    height: 70px;
    box-shadow: var(--shadow-sm);
  }

  .header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: var(--space-md);
  }

  .logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: light-dark(var(--color-wood-dark), var(--color-wood-light));
    transition: transform 0.3s ease;
  }

  .logo-accent {
    color: var(--text-accent);
    background: none;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
  }

  .logo:hover {
    transform: scale(1.02);
  }

  .nav-list {
    display: flex;
    gap: var(--space-md);
  }

  .nav-link {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-secondary);
    padding: 0.5rem 0.2rem;
    position: relative;
    transition: color 0.3s ease;
  }

  .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(to right, var(--color-wood-light), var(--color-resin-light));
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .nav-link:hover, .nav-link.active {
    color: var(--text-primary);
  }

  .nav-link:hover::after, .nav-link.active::after {
    width: 100%;
    left: 0;
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
  }

  /* THEME TOGGLE BUTTON */
  .theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .theme-toggle:hover {
    color: var(--text-primary);
    border-color: var(--border-color-focus);
    background-color: var(--bg-secondary);
    transform: rotate(15deg);
  }

  .theme-toggle svg {
    width: 20px;
    height: 20px;
  }

  /* Handle dynamic showing of icons via theme schemes */
  html:not([style*="color-scheme: dark"]) .sun-icon {
    display: none;
  }
  html[style*="color-scheme: dark"] .moon-icon {
    display: none;
  }

  /* When color-scheme isn't set yet (system auto), we can show/hide with media queries */
  @media (prefers-color-scheme: light) {
    html:not([style]) .sun-icon {
      display: none;
    }
  }
  @media (prefers-color-scheme: dark) {
    html:not([style]) .moon-icon {
      display: none;
    }
  }

  /* MOBILE NAVIGATION */
  .mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    z-index: 1001;
  }

  .mobile-menu-toggle .bar {
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: var(--radius-pill);
    transition: all 0.3s ease;
  }

  /* HERO SECTION */
  .hero-section {
    position: relative;
    min-height: 90dvh;
    display: flex;
    align-items: center;
    padding-top: 80px; /* Navigation spacing */
    background: url('assets/hero_background.png') no-repeat center center/cover;
    overflow: hidden;
  }

  .hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to bottom,
      light-dark(rgba(245, 240, 235, 0.5), rgba(10, 20, 18, 0.75)),
      light-dark(rgba(255, 255, 255, 0.95), var(--bg-primary))
    );
    z-index: 1;
  }

  .hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: flex-start;
  }

  .hero-text-card {
    max-width: 650px;
    padding: var(--space-lg);
    background-color: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
  }

  .hero-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background-color: light-dark(hsla(var(--hue-resin), 45%, 48%, 0.1), hsla(var(--hue-resin), 75%, 68%, 0.15));
    color: var(--text-accent);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: var(--radius-pill);
    margin-bottom: var(--space-sm);
    letter-spacing: 0.5px;
    text-transform: uppercase;
  }

  .hero-title {
    margin-bottom: var(--space-sm);
    letter-spacing: -1px;
  }

  .gradient-text {
    background: linear-gradient(135deg, var(--color-wood-light), var(--color-resin-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .hero-lead {
    font-size: clamp(1.1rem, 1rem + 0.3vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
  }

  .hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
  }

  .hero-social-links {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    padding-top: var(--space-sm);
  }

  .social-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-accent);
    font-weight: 600;
    transition: color 0.3s ease, transform 0.3s ease;
  }

  .social-link svg {
    width: 16px;
    height: 16px;
  }

  .social-link:hover {
    color: light-dark(var(--color-resin-light), #fff);
    transform: translateY(-1px);
  }

  /* SECTION STRUCTURES */
  .section-padding {
    padding-block: var(--space-xl);
  }

  .bg-subtle {
    background-color: var(--bg-secondary);
  }

  .section-subtitle {
    display: inline-block;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-accent);
    margin-bottom: var(--space-xs);
  }

  .section-title {
    margin-bottom: var(--space-md);
    letter-spacing: -0.5px;
  }

  .section-lead {
    max-width: 700px;
    margin-inline: auto;
    color: var(--text-secondary);
    font-size: 1.15rem;
  }

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

  .section-header {
    margin-bottom: var(--space-lg);
  }

  /* GRID 2 COLUMNS */
  .grid-2-col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    align-items: center;
  }

  /* CHI SIAMO (About Section) */
  .about-image-container {
    position: relative;
  }

  .image-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
  }

  .about-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    transition: transform 0.8s ease;
  }

  .image-wrapper:hover .about-image {
    transform: scale(1.05);
  }

  .experience-badge {
    position: absolute;
    bottom: var(--space-md);
    right: var(--space-md);
    background-color: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--shadow-md);
    z-index: 2;
    max-width: 160px;
    text-align: center;
  }

  .badge-number {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-accent);
    line-height: 1;
  }

  .badge-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .about-paragraph {
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
  }

  .about-features {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-md);
  }

  .feature-item {
    display: flex;
    gap: var(--space-sm);
  }

  .feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    background-color: light-dark(rgba(var(--hue-wood), 40%, 35%, 0.1), rgba(var(--hue-resin), 80%, 45%, 0.12));
    color: var(--text-accent);
  }

  .feature-icon svg {
    width: 24px;
    height: 24px;
  }

  .feature-info h3 {
    font-size: 1.15rem;
    margin-bottom: 4px;
  }

  .feature-info p {
    font-size: 0.95rem;
    color: var(--text-secondary);
  }

  /* LE NOSTRE CREAZIONI (Showcase Section) */
  .filter-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
  }

  .filter-btn {
    padding: 0.6rem 1.4rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    background-color: var(--bg-card);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .filter-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-color-focus);
    transform: translateY(-1px);
  }

  .filter-btn.active {
    background-color: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
    box-shadow: var(--shadow-sm);
  }

  .products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-md);
  }

  .product-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 168, 150, 0.15), var(--shadow-lg);
    border-color: var(--border-color-focus);
  }

  .product-image-container {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: var(--bg-secondary);
  }

  .product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .product-card:hover .product-image {
    transform: scale(1.06);
  }

  .product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--radius-sm);
    z-index: 2;
  }

  /* Swirling CSS Gradient Placeholders */
  .gradient-placeholder-card {
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease;
  }

  .board-placeholder {
    background: 
      radial-gradient(ellipse at bottom left, hsla(var(--hue-wood), 40%, 35%, 0.3), transparent 70%),
      repeating-linear-gradient(45deg, hsl(var(--hue-wood), 40%, 30%) 0px, hsl(var(--hue-wood), 40%, 30%) 10px, hsl(var(--hue-wood), 40%, 25%) 10px, hsl(var(--hue-wood), 40%, 25%) 20px);
  }

  .pen-placeholder {
    background: 
      radial-gradient(circle at top right, hsla(var(--hue-resin), 85%, 35%, 0.5), transparent 70%),
      repeating-conic-gradient(hsl(var(--hue-resin), 85%, 25%) 0% 25%, hsl(var(--hue-wood), 40%, 20%) 0% 50%) 0 / 40px 40px;
  }

  .coaster-placeholder {
    background: 
      radial-gradient(circle, hsla(var(--hue-resin), 85%, 35%, 0.3) 10%, transparent 60%),
      linear-gradient(135deg, hsl(var(--hue-wood), 40%, 25%) 0%, hsl(var(--hue-resin), 80%, 20%) 100%);
  }

  .box-placeholder {
    background: 
      radial-gradient(ellipse at center, hsla(300, 50%, 20%, 0.25) 10%, transparent 60%),
      linear-gradient(45deg, hsl(var(--hue-wood), 35%, 30%) 0%, hsl(300, 50%, 20%) 100%);
  }

  .product-info {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
  }

  .product-tag {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-accent);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
  }

  .product-title {
    font-size: 1.25rem;
    margin-bottom: 8px;
    font-weight: 700;
  }

  .product-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: var(--space-sm);
  }

  .product-status {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
  }

  .product-cta {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-accent);
    transition: all 0.3s ease;
  }

  .product-cta:hover {
    color: var(--text-primary);
    transform: translateX(2px);
  }

  /* TIMELINE PROCESS SECTION */
  .process-timeline {
    position: relative;
    max-width: 800px;
    margin-inline: auto;
    margin-top: var(--space-lg);
  }

  /* Vertical timeline center bar */
  .process-timeline::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 20px;
    bottom: 20px;
    width: 2px;
    background: linear-gradient(
      to bottom,
      var(--color-wood-light) 0%,
      var(--color-resin-light) 100%
    );
  }

  .process-step {
    position: relative;
    padding-left: 70px;
    margin-bottom: var(--space-lg);
  }

  .process-step:last-child {
    margin-bottom: 0;
  }

  .step-number-container {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    z-index: 2;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .step-number {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text-accent);
  }

  .process-step:hover .step-number-container {
    border-color: var(--border-color-focus);
    background-color: var(--border-color-focus);
  }

  .process-step:hover .step-number {
    color: var(--bg-primary);
  }

  .step-content h3 {
    font-size: 1.35rem;
    margin-bottom: 8px;
  }

  .step-content p {
    color: var(--text-secondary);
  }

  /* CONTATTI (Contact Section) */
  .contact-info-panel {
    display: flex;
    flex-direction: column;
  }

  .contact-lead {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: var(--space-md);
  }

  .contact-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
  }

  .contact-detail-item {
    display: flex;
    gap: var(--space-sm);
  }

  .contact-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-accent);
    flex-shrink: 0;
  }

  .contact-icon svg {
    width: 22px;
    height: 22px;
  }

  .contact-text h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-secondary);
  }

  .contact-text p {
    font-size: 1.1rem;
    font-weight: 700;
  }

  .contact-link {
    position: relative;
  }

  .contact-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
  }

  .contact-link:hover::after {
    transform: scaleX(1);
  }

  .social-box {
    margin-top: auto;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
  }

  .social-box h4 {
    font-size: 0.95rem;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
  }

  .social-buttons-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
  }

  /* CONTACT FORM */
  .glass-card {
    background-color: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-lg);
  }

  .glass-card h3 {
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
  }

  .form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: var(--space-sm);
    position: relative;
  }

  .form-group label {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
  }

  .form-group input, 
  .form-group textarea,
  .form-group select {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
  }

  /* Stylings on interactives */
  .form-group input::placeholder, 
  .form-group textarea::placeholder {
    color: light-dark(hsl(0, 0%, 65%), hsl(var(--hue-resin), 8%, 45%));
  }

  .form-group input:focus, 
  .form-group textarea:focus,
  .form-group select:focus {
    border-color: var(--border-color-focus);
    background-color: var(--bg-card);
    box-shadow: 0 0 0 4px light-dark(rgba(var(--hue-wood), 40%, 35%, 0.1), rgba(var(--hue-resin), 85%, 35%, 0.12));
    outline: none;
  }

  /* Custom dropdown styling using picker */
  .custom-select-wrapper {
    position: relative;
  }

  /* HTML5 validation helper styling: user-invalid */
  .form-group input:user-invalid, 
  .form-group textarea:user-invalid,
  .form-group select:user-invalid {
    border-color: #dc2743;
    box-shadow: 0 0 0 4px rgba(220, 39, 67, 0.1);
  }

  .form-group.has-error input,
  .form-group.has-error textarea,
  .form-group.has-error select {
    border-color: #dc2743;
    box-shadow: 0 0 0 4px rgba(220, 39, 67, 0.1);
  }

  .error-message {
    display: none;
    font-size: 0.8rem;
    font-weight: 600;
    color: #dc2743;
    margin-top: 4px;
  }

  .form-group.has-error .error-message {
    display: block;
  }

  .form-success-alert {
    display: flex;
    gap: var(--space-sm);
    background-color: light-dark(rgba(74, 150, 100, 0.15), rgba(74, 150, 100, 0.2));
    border: 1px solid rgba(74, 150, 100, 0.4);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-top: var(--space-md);
    animation: slideInUp 0.4s ease;
  }

  .form-success-alert[hidden] {
    display: none !important;
  }

  .success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #27ae60;
    color: #fff;
    flex-shrink: 0;
  }

  .success-icon svg {
    width: 24px;
    height: 24px;
  }

  .success-content h4 {
    font-size: 1.1rem;
    color: #27ae60;
    margin-bottom: 2px;
  }

  .success-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
  }

  /* FOOTER */
  .main-footer {
    background-color: light-dark(hsl(var(--hue-wood), 25%, 15%), hsl(var(--hue-resin), 20%, 5%));
    color: light-dark(hsl(var(--hue-wood), 15%, 80%), hsl(0, 0%, 80%));
    padding-top: var(--space-xl);
    padding-bottom: var(--space-md);
    border-top: 1px solid var(--border-color);
  }

  .main-footer h3 {
    color: #fff;
    font-size: 1.15rem;
    margin-bottom: var(--space-sm);
  }

  .footer-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
  }

  .footer-brand .logo {
    color: #fff;
    margin-bottom: var(--space-sm);
    display: inline-block;
  }

  .footer-brand p {
    max-width: 400px;
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .footer-links a {
    transition: color 0.3s ease;
  }

  .footer-links a:hover {
    color: #fff;
  }

  .footer-social-icons {
    display: flex;
    gap: var(--space-xs);
  }

  .footer-social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    color: #fff;
    transition: all 0.3s ease;
  }

  .footer-social-icons a:hover {
    background-color: var(--color-resin-main);
    transform: translateY(-2px);
  }

  .footer-social-icons svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.2px;
  }

  .footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: var(--space-md);
    font-size: 0.85rem;
  }
}

@layer utilities {
  /* ANIMATIONS & TRANSITIONS (Scroll-Driven Reveals) */
  @keyframes slideInUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Scroll-driven reveals - Progressive enhancement */
  @media (prefers-reduced-motion: no-preference) {
    @supports ((animation-timeline: view()) and (animation-range: entry)) {
      
      @keyframes reveal-in {
        from {
          opacity: 0;
          transform: translateY(60px) scale(0.96);
        }
        to {
          opacity: 1;
          transform: translateY(0) scale(1);
        }
      }

      @keyframes reveal-out {
        to {
          opacity: 0;
          transform: translateY(-60px) scale(0.96);
        }
      }

      .fade-on-scroll {
        /* Attach entry and exit keyframes */
        animation: 
          reveal-in auto linear backwards, 
          reveal-out auto linear forwards;
        animation-timeline: view();
        animation-range: entry 10% entry 100%, exit 0% exit 90%;
      }
      
      /* Disable fade-on-scroll on some elements that shouldn't fade out of viewport on top, like the hero card */
      .hero-text-card.fade-on-scroll {
        animation: reveal-in auto linear backwards;
        animation-timeline: view();
        animation-range: entry 0% entry 70%;
      }
    }
  }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Medium Screens (Tablets) */
@media (max-width: 992px) {
  .grid-2-col {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .about-text-content {
    order: -1; /* Text first on tablet portrait */
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

/* Small Screens (Mobile) */
@media (max-width: 768px) {
  :root {
    --space-xl: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  }

  /* Responsive Mobile Menu Toggle */
  .mobile-menu-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-md);
    transform: translateY(-120%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
  }

  .nav-menu.open {
    transform: translateY(0);
  }

  .nav-list {
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
  }

  .hero-section {
    min-height: 80dvh;
    padding-top: 80px;
  }

  .hero-text-card {
    padding: var(--space-md);
  }

  .mobile-menu-toggle[aria-expanded="true"] .bar:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
  }

  .mobile-menu-toggle[aria-expanded="true"] .bar:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-toggle[aria-expanded="true"] .bar:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
  }
}

@media (pointer: coarse) {
  /* Enforce touch targets for coarse pointers (touch screens) */
  .nav-link, .filter-btn, .btn, .social-link, .product-cta, .theme-toggle {
    min-block-size: 44px;
    min-inline-size: 44px;
  }
}

/* Fallback for browsers that do not support Scroll-Driven Animations */
html.no-css-scroll-timeline .fade-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

html.no-css-scroll-timeline .fade-on-scroll.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Contest Page Styles
   ========================================================================== */

/* Spostamento del contenuto principale per evitare sovrapposizioni con l'header fisso */
.contest-main-content {
  padding-top: 100px;
}

/* Card principale Contest Hero */
.contest-hero-card {
  background-color: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-lg);
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Badge di stato del contest */
.contest-status-badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-sm);
}

.contest-status-badge.active {
  background-color: hsla(140, 60%, 40%, 0.15);
  color: #2e7d32;
  border: 1px solid rgba(46, 125, 50, 0.3);
}

.contest-status-badge.inactive {
  background-color: hsla(0, 0%, 50%, 0.1);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.contest-title-display {
  margin-bottom: var(--space-sm);
  font-size: clamp(2rem, 1.8rem + 1.2vw, 3rem);
}

.contest-description-display {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 750px;
  margin: 0 auto var(--space-md);
  line-height: 1.6;
}

/* Azioni del contest */
.contest-actions {
  display: flex;
  justify-content: center;
  margin-top: var(--space-md);
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

/* Griglia per i post degli utenti */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

/* Card del singolo post */
.post-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
}

.post-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg), 0 8px 24px rgba(var(--hue-wood), 30%, 20%, 0.1);
  border-color: var(--border-color-focus);
}

.post-card-image {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: var(--bg-secondary);
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.post-card:hover .post-card-image img {
  transform: scale(1.04);
}

.post-card-content {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.post-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-xs);
  margin-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.post-author {
  font-size: 1.15rem;
  font-weight: 700;
  color: light-dark(var(--color-wood-dark), #fff);
  margin: 0;
}

.post-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.post-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-line;
}

/* Stili Modali / Finestre di Dialogo */
.contest-modal {
  display: none;
  border: none;
  background: transparent;
  padding: 0;
  max-width: 600px;
  width: calc(100% - var(--space-md) * 2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, overlay 0.3s allow-discrete, display 0.3s allow-discrete;
}

.contest-modal[open] {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

@starting-style {
  .contest-modal[open] {
    opacity: 0;
    transform: translateY(20px);
  }
}

.contest-modal::backdrop {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease, overlay 0.3s allow-discrete, display 0.3s allow-discrete;
}

.contest-modal[open]::backdrop {
  opacity: 1;
}

@starting-style {
  .contest-modal[open]::backdrop {
    opacity: 0;
  }
}

.modal-content {
  background-color: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
}

.modal-content-sm {
  max-width: 450px;
  margin: 0 auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: var(--space-xs);
}

.modal-header h3 {
  margin: 0;
  font-family: var(--font-heading);
}

.modal-close-btn {
  font-size: 1.8rem;
  color: var(--text-secondary);
  line-height: 1;
  transition: color 0.2s ease;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-xs);
  margin-top: var(--space-md);
  border-top: 1px solid var(--border-color);
  padding-top: var(--space-sm);
}

/* Area Caricamento File */
.file-upload-wrapper {
  position: relative;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  text-align: center;
  background-color: var(--bg-secondary);
  transition: all 0.3s ease;
  cursor: pointer;
}

.file-upload-wrapper:hover, .file-upload-wrapper.dragover {
  border-color: var(--border-color-focus);
  background-color: light-dark(rgba(var(--hue-wood), 30%, 40%, 0.05), rgba(var(--hue-resin), 30%, 40%, 0.05));
}

.file-upload-wrapper input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.file-upload-trigger {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  color: var(--text-secondary);
}

.file-upload-trigger svg {
  color: var(--text-accent);
}

.file-upload-trigger span {
  font-size: 0.95rem;
}

.file-upload-trigger strong {
  color: var(--text-accent);
}

.file-info {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Anteprima dell'Immagine Caricata */
.image-preview-container {
  position: relative;
  margin-top: var(--space-sm);
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-height: 250px;
  border: 1px solid var(--border-color);
}

.image-preview-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 240px;
  background-color: #000;
}

.btn-remove-preview {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.btn-remove-preview:hover {
  background-color: #d32f2f;
}

/* Toast di Notifica */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: var(--bg-card);
  color: var(--text-primary);
  border-left: 4px solid var(--color-resin-main);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 1100;
  transform: translateY(120%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-notification.toast-show {
  transform: translateY(0);
}

.toast-notification.success {
  border-left-color: #2e7d32;
}

.toast-notification.error {
  border-left-color: #c62828;
}

.toast-notification.info {
  border-left-color: #1565c0;
}

/* Empty State Galleria vuota */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-color);
  max-width: 600px;
  margin: 0 auto;
}

.empty-state-icon {
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
  opacity: 0.6;
}

.empty-state h3 {
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

/* Pannello Admin */
.admin-panel {
  margin-top: 120px;
  margin-bottom: -60px;
}

.admin-panel-card {
  background-color: light-dark(hsl(var(--hue-wood), 20%, 93%), hsl(var(--hue-resin), 20%, 15%));
  border: 1px solid var(--border-color-focus);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-md);
}

.admin-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.admin-badge {
  background-color: var(--color-resin-main);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
}

.admin-instructions {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.admin-form .form-group label {
  font-weight: 600;
}

/* Link di accesso nel footer */
.btn-link {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-decoration: underline;
  transition: color 0.2s ease;
}

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

.btn-logged-in {
  color: var(--text-accent);
  font-weight: 600;
}

/* Stili errore nei campi di input */
.form-group.has-error input, .form-group.has-error textarea {
  border-color: #c62828;
}

.form-group.has-error .error-msg {
  display: block;
  color: #c62828;
  font-size: 0.8rem;
  margin-top: 4px;
}

.error-msg {
  display: none;
}

/* Animazione di errore login (shake) */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.shake {
  animation: shake 0.3s ease-in-out;
}

/* Spinner caricamento */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top-color: var(--color-resin-main);
  border-radius: 50%;
  animation: spin 1s infinite linear;
  margin: var(--space-md) auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Profile and Social Login Styles
   ========================================================================== */

/* Contenitore relativo dell'area profilo (Header) */
.profile-container {
  position: relative;
  display: inline-block;
}

/* Pulsante di attivazione profilo / Accedi */
.profile-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  height: 42px;
}

.profile-trigger-btn:hover {
  border-color: var(--border-color-focus);
  background-color: var(--bg-secondary);
  transform: translateY(-1px);
}

.profile-trigger-btn svg.user-icon {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

.profile-trigger-btn.logged-in {
  padding-inline-start: 6px;
}

/* Avatar circolare nell'header */
.user-avatar-img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--text-accent);
}

.chevron-icon {
  width: 14px;
  height: 14px;
  color: var(--text-secondary);
  transition: transform 0.3s ease;
}

.profile-trigger-btn:focus-visible {
  outline: 2px solid var(--border-color-focus);
}

/* Dropdown del profilo */
.profile-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 320px;
  background-color: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-md);
  z-index: 1010;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  animation: dropdown-fade-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform-origin: top right;
}

.profile-dropdown[hidden] {
  display: none !important;
}

@keyframes dropdown-fade-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Header del dropdown (Dettagli utente) */
.dropdown-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: var(--space-sm);
}

.dropdown-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.dropdown-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--text-accent);
}

/* Iniziali di fallback se non c'è la foto profilo */
.dropdown-initials {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-color: var(--color-resin-main);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.5rem;
  border: 2px solid var(--color-resin-light);
}

.dropdown-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dropdown-user-info h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-user-info p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Badge del provider (Google/Facebook) */
.provider-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  margin-top: 4px;
  align-self: flex-start;
  text-transform: uppercase;
}

.provider-badge.google {
  background-color: rgba(234, 67, 53, 0.1);
  color: #ea4335;
  border: 1px solid rgba(234, 67, 53, 0.2);
}

.provider-badge.facebook {
  background-color: rgba(24, 119, 242, 0.1);
  color: #1877f2;
  border: 1px solid rgba(24, 119, 242, 0.2);
}

/* Moduli del Dropdown */
.dropdown-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dropdown-form label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.dropdown-form input {
  padding: 6px 12px;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  width: 100%;
}

.dropdown-form input:focus {
  border-color: var(--border-color-focus);
  outline: none;
}

.dropdown-footer {
  border-top: 1px solid var(--border-color);
  padding-top: var(--space-sm);
}

/* Pulsanti Login Social */
.social-login-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: var(--space-md);
}

.social-login-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 8px;
}

/* Google Button */
.btn-social-google {
  background-color: #ffffff;
  color: #3c4043;
  border: 1px solid #dadce0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: all 0.2s ease;
}

.btn-social-google:hover {
  background-color: #f8f9fa;
  border-color: #d2d4d7;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.btn-social-google svg {
  flex-shrink: 0;
}

/* Facebook Button */
.btn-social-fb {
  background-color: #1877f2;
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.2);
  transition: all 0.2s ease;
}

.btn-social-fb:hover {
  background-color: #166fe5;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(24, 119, 242, 0.35);
}

.btn-social-fb svg {
  flex-shrink: 0;
}

/* Divisore tra Social e Backup Credentials */
.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-block: var(--space-md);
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.divider:not(:empty)::before {
  margin-right: 16px;
}

.divider:not(:empty)::after {
  margin-left: 16px;
}

/* Form di Login Secondario di Backup */
.backup-login-form {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  background-color: var(--bg-secondary);
}

.backup-login-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  margin-bottom: var(--space-xs);
}

/* Ottimizzazione touch targets per pulsanti del dropdown */
.profile-dropdown .btn {
  min-height: 38px;
}

@media (max-width: 768px) {
  .profile-dropdown {
    width: 290px;
    right: -10px; /* Centra meglio su schermi molto stretti */
  }
}

/* ==========================================================================
   Admin Contests History Table Styles
   ========================================================================== */

.admin-contests-list-section {
  margin-top: 2.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
}

.admin-contests-list-section h3 {
  margin-bottom: 1rem;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
}

.admin-contests-table-wrapper {
  overflow-x: auto;
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
}

.admin-contests-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.admin-contests-table th {
  padding: 14px 18px;
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
}

.admin-contests-table td {
  padding: 14px 18px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  transition: background-color 0.2s ease;
}

.admin-contests-table tr:last-child td {
  border-bottom: none;
}

.admin-contests-table tbody tr {
  transition: background-color 0.2s ease;
}

.admin-contests-table tbody tr:hover {
  background-color: light-dark(rgba(139, 69, 19, 0.03), rgba(219, 112, 147, 0.03));
}

/* Specific column styles */
.admin-contests-table .col-title {
  font-weight: 600;
  color: light-dark(var(--color-wood-dark), #fff);
  min-width: 200px;
}

.admin-contests-table .col-date {
  color: var(--text-secondary);
  font-size: 0.9rem;
  white-space: nowrap;
}

.admin-contests-table .col-status {
  white-space: nowrap;
}

.admin-contests-table .col-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Badges inside table */
.table-badge {
  margin-bottom: 0 !important;
  font-size: 0.75rem !important;
  padding: 4px 10px !important;
  border-radius: var(--radius-pill);
}

/* Empty & Loading states */
.table-empty, .table-loading {
  padding: 24px !important;
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
}

/* Adjust button states for table context */
.admin-contests-table .btn {
  padding: 6px 12px;
  font-size: 0.85rem;
  min-height: auto;
}

.admin-contests-table .btn-delete {
  color: #c62828;
  border-color: rgba(198, 40, 40, 0.3);
}

.admin-contests-table .btn-delete:hover {
  background-color: rgba(198, 40, 40, 0.08);
  border-color: #c62828;
}

.admin-contests-table .btn-deactivate {
  color: var(--text-primary);
  border-color: var(--border-color);
}

.admin-contests-table .btn-deactivate:hover {
  background-color: var(--bg-secondary);
  border-color: var(--text-secondary);
}

/* ==========================================================================
   Contest Forum Layout & Thread Card Styles
   ========================================================================== */

/* Griglia dei contest */
.contests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

/* Card del singolo contest */
.contest-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
}

.contest-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg), 0 8px 24px rgba(var(--hue-wood), 30%, 20%, 0.1);
  border-color: var(--border-color-focus);
}

.contest-card-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: var(--bg-secondary);
  cursor: pointer;
}

.contest-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.contest-card:hover .contest-cover-img {
  transform: scale(1.04);
}

.contest-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.gradient-wood-resin {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, hsl(var(--hue-wood), 45%, 25%), hsl(var(--hue-resin), 45%, 35%));
}

.contest-card-content {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: var(--space-xs);
}

.contest-card-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.contest-card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: light-dark(var(--color-wood-dark), #fff);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.contest-card-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.contest-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-color);
}

.contest-replies-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.contest-replies-count svg {
  color: var(--text-accent);
}

/* Dettaglio Thread Contest Principale */
.contest-thread-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.contest-thread-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: var(--space-sm);
}

.thread-author-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.thread-author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--color-resin-main);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  border: 2px solid var(--color-resin-light);
  flex-shrink: 0;
}

.thread-author-name {
  font-weight: 700;
  color: light-dark(var(--color-wood-dark), #fff);
  display: flex;
  align-items: center;
  font-size: 1.05rem;
}

.admin-badge-inline {
  display: inline-block;
  background-color: light-dark(rgba(219, 112, 147, 0.1), rgba(219, 112, 147, 0.2));
  color: var(--text-accent);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  margin-left: 8px;
  border: 1px solid light-dark(rgba(219, 112, 147, 0.2), rgba(219, 112, 147, 0.3));
}

.thread-date {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.contest-thread-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.thread-title {
  font-size: clamp(1.8rem, 1.5rem + 1.2vw, 2.2rem);
  font-weight: 800;
  margin: 0;
  color: light-dark(var(--color-wood-dark), #fff);
}

.thread-desc {
  font-size: 1.05rem;
  color: var(--text-primary);
  line-height: 1.6;
  white-space: pre-line;
  margin: 0;
}

.contest-thread-cover {
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-height: 420px;
  width: 100%;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
}

.contest-thread-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-height: 420px;
}

/* Dettagli risposte */
.reply-post-card {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.reply-post-card:hover {
  transform: translateY(-4px);
}

.reply-number {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-accent);
  background-color: light-dark(hsla(var(--hue-resin), 45%, 48%, 0.1), hsla(var(--hue-resin), 75%, 68%, 0.15));
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid light-dark(hsla(var(--hue-resin), 45%, 48%, 0.15), hsla(var(--hue-resin), 75%, 68%, 0.25));
}

/* Animazione Shake per Login Errato */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15%, 55%, 95% { transform: translateX(-6px); }
  35%, 75% { transform: translateX(6px); }
}

.shake {
  animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@media (max-width: 576px) {
  .contest-thread-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }
  .contest-status-badge {
    align-self: flex-start;
  }
}

/* ==========================================================================
   Profile Page & Favorite Heart Button Styles
   ========================================================================== */

/* Bottone Cuore Preferiti */
.btn-favorite-post {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: light-dark(rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.06));
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  padding: 0;
}

.btn-favorite-post:hover {
  background-color: light-dark(rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.12));
  color: var(--text-accent);
  transform: scale(1.08);
}

.btn-favorite-post.favorited {
  background-color: light-dark(hsla(var(--hue-resin), 45%, 48%, 0.12), hsla(var(--hue-resin), 75%, 68%, 0.18));
  color: var(--text-accent);
  border-color: light-dark(hsla(var(--hue-resin), 45%, 48%, 0.25), hsla(var(--hue-resin), 75%, 68%, 0.35));
}

.btn-favorite-post.favorited svg {
  animation: heart-beat 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes heart-beat {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* Layout Pagina Profilo */
.profile-main-content {
  background-color: var(--bg-primary);
  min-height: calc(100vh - 80px - 280px); /* Riempi spazio tra header & footer */
  padding-top: 80px; /* Spazio per header */
}

.profile-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: var(--space-lg);
  align-items: start;
}

.profile-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  position: sticky;
  top: 100px;
}

.profile-avatar-large {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  margin-inline: auto;
  border: 3px solid var(--text-accent);
  box-shadow: var(--shadow-sm);
  background-color: var(--bg-secondary);
}

.profile-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-initials-large {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 2.5rem;
  color: #fff;
  background-color: var(--color-resin-main);
}

.profile-user-display-name {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: var(--space-xs);
  margin-bottom: 4px;
}

.profile-update-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.profile-update-form input[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
  background-color: light-dark(rgba(0, 0, 0, 0.02), rgba(255, 255, 255, 0.02));
}

/* Sezione Preferiti */
.profile-favorites-column {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: var(--space-md);
  min-height: 480px;
}

.favorites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

/* Modifiche per i pulsanti menu dropdown */
.dropdown-menu-item {
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-body);
}

.dropdown-menu-item:hover {
  background-color: light-dark(rgba(0, 0, 0, 0.03), rgba(255, 255, 255, 0.03));
}

@media (max-width: 900px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }
  .profile-card {
    position: static;
  }
}

/* Interattività Contest Hero Banner in Home */
.contest-hero-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  max-width: 900px;
  margin: 0 auto;
  transition: transform var(--transition-normal, 0.3s), box-shadow var(--transition-normal, 0.3s);
}
.contest-hero-card-link:hover {
  transform: translateY(-5px);
}
.contest-hero-card-link:hover .contest-hero-card {
  border-color: var(--color-resin-main);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

/* Badge per Autori Post (Admin e Utente) */
.forum-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm, 4px);
  line-height: 1;
}

.forum-badge.admin {
  background-color: hsla(24, 75%, 50%, 0.15);
  color: #d84315;
  border: 1px solid rgba(216, 67, 21, 0.3);
}

.forum-badge.user {
  background-color: light-dark(rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.05));
  color: var(--text-secondary);
  border: 1px solid transparent;
}

/* ==========================================================================
   Gestione Creazioni Admin & Preferiti (Cuori)
   ========================================================================== */

/* Bottone Cuore Preferiti Prodotto */
.btn-favorite-product {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  padding: 0;
  z-index: 2;
}

.btn-favorite-product:hover {
  background-color: light-dark(rgba(255, 255, 255, 0.9), rgba(28, 16, 18, 0.95));
  color: #e0245e;
  transform: scale(1.08);
}

.btn-favorite-product.favorited {
  background-color: light-dark(rgba(224, 36, 94, 0.1), rgba(224, 36, 94, 0.2));
  color: #e0245e;
  border-color: rgba(224, 36, 94, 0.35);
}

.btn-favorite-product.favorited svg {
  fill: #e0245e;
  animation: heart-beat 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

/* Pannello Admin Creazioni */
.admin-panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

/* Griglia pulsanti tab dei preferiti */
.favorites-tabs {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.favorites-tabs .tab-btn {
  background: none;
  border: none;
  padding: 6px 12px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
}

.favorites-tabs .tab-btn:hover {
  color: var(--text-primary);
}

.favorites-tabs .tab-btn.active {
  color: var(--color-resin-main);
  border-bottom-color: var(--color-resin-main);
}

/* Bottone elimina per admin sulle card creazioni */
.btn-delete-product {
  padding: 6px 12px;
  font-size: 0.85rem;
  color: #c62828;
  border: 1px solid rgba(198, 40, 40, 0.3);
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: var(--space-xs);
  min-height: auto;
}

.btn-delete-product:hover {
  background-color: rgba(198, 40, 40, 0.05);
  border-color: #c62828;
}

/* ============================================================
   LIGHTBOX CREAZIONI
   ============================================================ */
.product-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: lightboxFadeIn 0.25s ease;
}

.product-lightbox.closing {
  animation: lightboxFadeOut 0.2s ease forwards;
}

@keyframes lightboxFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes lightboxFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

.lightbox-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  gap: 0;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
  animation: lightboxSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes lightboxSlideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.lightbox-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0,0,0,0.35);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background 0.2s, transform 0.15s;
}
.lightbox-close-btn:hover {
  background: rgba(0,0,0,0.6);
  transform: scale(1.1);
}

.lightbox-image-wrap {
  flex: 0 0 52%;
  min-height: 340px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
}

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

.lightbox-info {
  flex: 1;
  padding: 2rem 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}

.lightbox-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lightbox-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-resin-main);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lightbox-tag {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.lightbox-title {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  margin: 0;
}

.lightbox-description {
  font-size: 0.97rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
  flex: 1;
}

.lightbox-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.lightbox-status {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-accent);
  background: rgba(var(--color-resin-rgb, 139, 90, 43), 0.1);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

.lightbox-cta {
  flex-shrink: 0;
}

/* Cursore pointer sulle card cliccabili */
.product-card.lightbox-enabled {
  cursor: pointer;
}
.product-card.lightbox-enabled .product-image-container::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.25s ease;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  pointer-events: none;
}
.product-card.lightbox-enabled:hover .product-image-container::after {
  background: rgba(0,0,0,0.12);
}

/* Responsive lightbox */
@media (max-width: 680px) {
  .lightbox-container {
    flex-direction: column;
    max-height: 95vh;
  }
  .lightbox-image-wrap {
    flex: 0 0 240px;
    min-height: 240px;
  }
  .lightbox-info {
    padding: 1.2rem 1rem;
    gap: 0.75rem;
  }
  .lightbox-title {
    font-size: 1.2rem;
  }
}

