:root {
  --primary-color: #4aa08f;
  --primary-dark: #3c8576;
  --accent-color: #009bd6;
  --accent-light: #00a8e8;
  --wiggle-intensity: 0.5deg;
  --hard-wiggle-intensity: 2deg;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  color: #333;
  background-color: #f9f9f9;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header styles */
.lazyHeader {
  width: 100%;
  text-align: center;
  padding: 20px 10px;
  background: linear-gradient(135deg, #fff6b7 0%, #91ab5b 100%);
}

.header-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.welcome-to {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: bold;
  color: #333;
}

.pincil {
  width: min(90%, 500px);
  height: auto;
  margin: 0 auto;
}

.pincil text {
  font-size: clamp(2rem, 6vw, 4.5rem);
  letter-spacing: clamp(2px, 1vw, 5px);
}

/* Secondary header */
.secondaryHeader {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, #4aa08f, #3c8576);
  color: white;
  margin: 0;
}

.secondaryHeader p {
  font-size: clamp(1rem, 3vw, 1.2rem);
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Products hero section */
.products-hero {
  text-align: center;
  padding: clamp(20px, 5vw, 40px) 20px;
  background-color: white;
}

.products-hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  color: #333;
  margin-bottom: 10px;
}

.products-hero p {
  font-size: clamp(1rem, 3vw, 1.2rem);
  color: #666;
  max-width: 600px;
  margin: 0 auto;
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: clamp(15px, 3vw, 20px);
  padding: clamp(15px, 3vw, 20px);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Product card */
.product-card {
  background: linear-gradient(145deg, var(--primary-color), var(--primary-dark));
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  transform: translateY(30px);
  opacity: 0;
  animation: fadeUp .6s ease forwards;
  box-shadow: 
    0 10px 20px rgba(0,0,0,.15),
    0 0 0 3px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: 
    transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 0.4s ease,
    background 0.3s ease,
    filter 0.3s ease;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: 
    fadeUp .6s ease forwards,
    gentleWiggle 8s ease-in-out infinite;
  animation-delay: calc(var(--animation-order, 0) * 0.1s);
  will-change: transform;
  filter: brightness(0.95);
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Enhanced wiggle animations */
@keyframes gentleWiggle {
  0%, 95%, 100% { 
    transform: translateY(0) rotate(0deg); 
  }
  96% { 
    transform: translateY(-1px) rotate(var(--wiggle-intensity)); 
  }
  97% { 
    transform: translateY(0) rotate(calc(var(--wiggle-intensity) * -1)); 
  }
  98% { 
    transform: translateY(1px) rotate(calc(var(--wiggle-intensity) * 0.5)); 
  }
}

@keyframes hardWiggle {
  0%, 90%, 100% { 
    transform: translateY(0) rotate(0deg) scale(1); 
  }
  91% { 
    transform: translateY(-3px) rotate(calc(var(--hard-wiggle-intensity) * 1)) scale(1.01); 
  }
  92% { 
    transform: translateY(2px) rotate(calc(var(--hard-wiggle-intensity) * -1.5)) scale(1.02); 
  }
  93% { 
    transform: translateY(-2px) rotate(calc(var(--hard-wiggle-intensity) * 1.2)) scale(1.01); 
  }
  94% { 
    transform: translateY(0) rotate(calc(var(--hard-wiggle-intensity) * -0.8)) scale(1); 
  }
}

/* Apply hard wiggle animations */
.product-card:nth-child(6n+1) { 
  animation: fadeUp .6s ease forwards, gentleWiggle 8s ease-in-out infinite, hardWiggle 25s ease-in-out infinite; 
}
.product-card:nth-child(6n+2) { 
  animation: fadeUp .6s ease forwards, gentleWiggle 8s ease-in-out infinite, hardWiggle 30s ease-in-out infinite; 
  animation-delay: calc(var(--animation-order, 0) * 0.1s), calc(var(--animation-order, 0) * 0.1s), 2s; 
}
.product-card:nth-child(6n+3) { 
  animation: fadeUp .6s ease forwards, gentleWiggle 8s ease-in-out infinite, hardWiggle 35s ease-in-out infinite; 
  animation-delay: calc(var(--animation-order, 0) * 0.1s), calc(var(--animation-order, 0) * 0.1s), 5s; 
}
.product-card:nth-child(6n+4) { 
  animation: fadeUp .6s ease forwards, gentleWiggle 8s ease-in-out infinite, hardWiggle 40s ease-in-out infinite; 
  animation-delay: calc(var(--animation-order, 0) * 0.1s), calc(var(--animation-order, 0) * 0.1s), 8s; 
}
.product-card:nth-child(6n+5) { 
  animation: fadeUp .6s ease forwards, gentleWiggle 8s ease-in-out infinite, hardWiggle 45s ease-in-out infinite; 
  animation-delay: calc(var(--animation-order, 0) * 0.1s), calc(var(--animation-order, 0) * 0.1s), 12s; 
}
.product-card:nth-child(6n+6) { 
  animation: fadeUp .6s ease forwards, gentleWiggle 8s ease-in-out infinite, hardWiggle 50s ease-in-out infinite; 
  animation-delay: calc(var(--animation-order, 0) * 0.1s), calc(var(--animation-order, 0) * 0.1s), 15s; 
}

/* Hover effect */
.product-card:hover {
  transform: translateY(-8px) scale(1.03) rotate(1deg);
  box-shadow: 
    0 20px 40px rgba(0,0,0,.3),
    0 0 0 3px rgba(74, 160, 143, 0.4),
    0 0 40px rgba(74, 160, 143, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  background: linear-gradient(145deg, #52b09e, #459285);
  filter: brightness(1.1);
  animation-play-state: paused;
}

/* Image section */
.image-wrap {
  position: relative;
  background: linear-gradient(45deg, #e0e0e0, #f5f5f5);
  padding: clamp(10px, 3vw, 15px);
  overflow: hidden;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.image-wrap img {
  width: 100%;
  max-width: 200px;
  height: auto;
  border-radius: 10px;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  filter: brightness(0.95) saturate(0.9) contrast(1.05);
  object-fit: contain;
}

.product-card:hover .image-wrap img {
  transform: scale(1.12) rotate(0.5deg);
  filter: brightness(1.1) saturate(1.2) contrast(1.1);
}

/* Bonus badge */
.bonus {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(145deg, var(--accent-color), var(--primary-dark));
  color: #fff;
  font-size: clamp(10px, 2.5vw, 11px);
  padding: clamp(6px, 2vw, 8px) clamp(8px, 2vw, 10px);
  border-radius: 15px;
  text-align: center;
  line-height: 1.3;
  font-weight: bold;
  z-index: 10;
  box-shadow: 
    0 6px 12px rgba(0, 0, 0, 0.25),
    0 0 0 2px rgba(255, 255, 255, 0.2);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: bonusFloat 4s ease-in-out infinite;
  backdrop-filter: blur(4px);
}

@keyframes bonusFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(2deg); }
}

.product-card:hover .bonus {
  transform: scale(1.15) rotate(8deg) !important;
  box-shadow: 
    0 10px 20px rgba(0, 0, 0, 0.4),
    0 0 0 3px rgba(255, 255, 255, 0.3),
    0 0 20px rgba(0, 155, 214, 0.5);
  background: linear-gradient(145deg, var(--accent-light), var(--accent-color));
  animation: none;
}

/* Info section */
.info {
  padding: clamp(14px, 4vw, 18px);
  border-top: 2px dashed rgba(255, 255, 255, 0.6);
  position: relative;
  overflow: hidden;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.15));
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-grow: 1;
}

.title {
  font-size: clamp(13px, 3vw, 14px);
  font-weight: 700;
  margin-bottom: clamp(6px, 2vw, 8px);
  line-height: 1.4;
  transition: all 0.3s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.product-card:hover .title {
  transform: translateX(4px);
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.price {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.price .current {
  font-weight: 800;
  font-size: clamp(16px, 4vw, 18px);
  color: #fff;
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
  position: relative;
  display: inline-block;
  padding: 2px 0;
}

.price .current::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-light), #fff);
  transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-radius: 1px;
}

.product-card:hover .price .current::after {
  width: 100%;
}

.price .old {
  text-decoration: line-through;
  opacity: .5;
  font-size: clamp(12px, 3vw, 13px);
  transition: all 0.3s ease;
}

.product-card:hover .price .old {
  opacity: .7;
  transform: translateX(2px);
}

@keyframes fadeUp {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Staggered animation delays */
.product-card:nth-child(6n+1) { --animation-order: 1; --wiggle-intensity: 0.4deg; --hard-wiggle-intensity: 2.2deg; }
.product-card:nth-child(6n+2) { --animation-order: 2; --wiggle-intensity: -0.5deg; --hard-wiggle-intensity: -1.8deg; }
.product-card:nth-child(6n+3) { --animation-order: 3; --wiggle-intensity: 0.6deg; --hard-wiggle-intensity: 2.5deg; }
.product-card:nth-child(6n+4) { --animation-order: 4; --wiggle-intensity: -0.4deg; --hard-wiggle-intensity: -2deg; }
.product-card:nth-child(6n+5) { --animation-order: 5; --wiggle-intensity: 0.7deg; --hard-wiggle-intensity: 1.5deg; }
.product-card:nth-child(6n+6) { --animation-order: 6; --wiggle-intensity: -0.6deg; --hard-wiggle-intensity: -2.2deg; }

/* Printables section */
.post {
  padding: clamp(20px, 5vw, 40px) 20px;
  background-color: white;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.posts-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: clamp(20px, 4vw, 30px);
  margin-top: 20px;
}

/* Dropdown posts */
.dropdown-post {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 1px solid #eaeaea;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.dropdown-post:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  transform: translateY(-5px);
}

.dropdown-header {
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.dropdown-header img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.dropdown-post:hover .dropdown-header img {
  transform: scale(1.05);
}

.dropdown-arrow-container {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(74, 160, 143, 0.9);
  border-radius: 50%;
  width: 45px;
  height: 45px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
}

.dropdown-arrow {
  font-size: 1.5rem;
  color: white;
  transition: transform 0.3s ease;
}

.dropdown-post.open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-post.open .dropdown-arrow-container {
  background-color: rgba(0, 155, 214, 0.9);
}

.dropdown-description {
  padding: 20px;
  background-color: white;
  display: none;
  flex-grow: 1;
}

.dropdown-post.open .dropdown-description {
  display: block;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-description h3 {
  font-size: clamp(1.1rem, 3vw, 1.3rem);
  color: #333;
  margin-bottom: 15px;
  text-align: center;
}

.dropdown-description h3 a {
  color: #4aa08f;
  text-decoration: none;
  transition: color 0.3s ease;
}

.dropdown-description h3 a:hover {
  color: #009bd6;
}

.dropdown-description p,
.dropdown-description li {
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  color: #555;
  line-height: 1.6;
  margin-bottom: 10px;
  text-align: left;
}

.dropdown-description ul {
  padding-left: 20px;
  margin: 15px 0;
}

.dropdown-description li {
  margin-bottom: 8px;
}

.dropdown-description strong {
  color: #333;
}

/* Footer */
footer {
  margin-top: auto;
  background: linear-gradient(135deg, #4aa08f, #3c8576);
  color: white;
  text-align: center;
  padding: 20px;
  width: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
    gap: 15px;
    padding: 15px;
  }
  
  .product-card {
    border-radius: 14px;
    --wiggle-intensity: 0.3deg;
    --hard-wiggle-intensity: 1.5deg;
  }
  
  .image-wrap {
    min-height: 140px;
    padding: 10px;
  }
  
  .image-wrap img {
    max-width: 150px;
  }
  
  .info {
    padding: 12px;
    min-height: 80px;
  }
  
  .bonus {
    font-size: 9px;
    padding: 5px 8px;
    top: 8px;
    right: 8px;
  }
  
  .posts-row {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
    gap: 20px;
  }
  
  .dropdown-header img {
    height: 180px;
  }
  
  .dropdown-description {
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .pincil {
    width: 90%;
  }
  
  .pincil text {
    font-size: clamp(1.8rem, 8vw, 2.5rem);
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr));
    gap: 12px;
    padding: 12px;
  }
  
  .product-card {
    border-radius: 12px;
    --wiggle-intensity: 0.2deg;
    --hard-wiggle-intensity: 1.2deg;
  }
  
  .image-wrap {
    min-height: 120px;
    padding: 8px;
  }
  
  .image-wrap img {
    max-width: 130px;
  }
  
  .info {
    padding: 10px;
    min-height: 70px;
  }
  
  .title {
    font-size: 12px;
    line-height: 1.3;
  }
  
  .price .current {
    font-size: 14px;
  }
  
  .price .old {
    font-size: 11px;
  }
  
  .bonus {
    font-size: 8px;
    padding: 4px 6px;
    top: 6px;
    right: 6px;
  }
  
  .posts-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .dropdown-header img {
    height: 160px;
  }
  
  .dropdown-arrow-container {
    width: 40px;
    height: 40px;
  }
  
  .dropdown-arrow {
    font-size: 1.2rem;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .product-card {
    animation: 
      fadeUp .6s ease forwards,
      gentleWiggle 12s ease-in-out infinite;
  }
  
  .product-card:active {
    transform: translateY(-3px) scale(0.98);
  }
  
  .dropdown-post:active {
    transform: translateY(-2px);
  }
}

/* Ensure proper layout on very small screens */
@media (max-width: 320px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
  
  .posts-row {
    grid-template-columns: 1fr;
  }
  
  .dropdown-header img {
    height: 150px;
  }
}