.products-section {
  padding: 4rem 2rem;
  background: #f9f9f9;
  
}

.products-section h2 {
  font-size: 2.5rem;
  letter-spacing: 0.08em;
  margin-bottom: 2rem;
  text-align: center;
}

/* === Grid Layout === */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2rem;
}

/* === Flip Card Setup === */
.flip-container {
  perspective: 1000px;
  width: 100%;
  position: relative;
  cursor: pointer;
  overflow: visible;           /* allow height to expand */
}
html, body,
.flip-container, .flip-inner, .flip-front, .flip-back {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.flip-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.8s ease;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* === Front and Back Shared Styles === */
.flip-front,
.flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  border-radius: 50% 50% 50% 50% / 10% 10% 20% 20%;
  background: #fff;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 0;
  box-sizing: border-box;
}
.flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;

  border-radius: 50% 50% 50% 50% / 10% 10% 20% 20%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  box-sizing: border-box;

  /* Animated two-color gradient */
  background: linear-gradient(145deg, #ffffff, #c8796c, #ffffff);
  background-size: 300% 300%;
  animation: flipBackFlow 18s cubic-bezier(0.4, 0, 0.2, 1) infinite;

  /* Add depth and soft reflection */
  box-shadow:
    inset 0 0 25px rgba(255, 255, 255, 0.05),
    0 5px 20px rgba(0, 0, 0, 0.112);
  color: #fff;
}

/* Smooth gradient movement */
@keyframes flipBackFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* === Front Side === */
.flip-front {
  transform: rotateY(0deg);
  z-index: 2;
}

.flip-front img {
  width: 100%;
  /* Responsive height: scales with viewport, stays within safe min/max limits */
  height: clamp(180px, 32vw, 260px);
  object-fit: cover;

  /* keep your rounded corners consistent */
  border-top-left-radius: 40% 10%;
  border-top-right-radius: 40% 10%;
}
/* Make this the base (desktop & mobile) */
.flip-inner {
  width: 100%;
  position: relative;
  display: grid;                 /* overlays faces while allowing auto height */
  transition: transform 0.8s ease;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  /* remove height:100% here */
}
.animated-buy-button {
  display: inline-block;   /* keeps button size correct */
  margin-bottom: 1rem;     /* adjust space — try 1.2rem or 16px if needed */
}
.flip-front,
.flip-back {
  position: relative;            /* was absolute */
  grid-area: 1 / 1;              /* stack both faces */
  width: 100%;
  height: auto;                  /* was 100% -> caused 0px when parent had no height */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  /* keep your existing radius/shadow/background/flex here */
}

.flip-back { transform: rotateY(180deg); }


/* === Back Side === */
.flip-back {
  transform: rotateY(180deg);
  z-index: 1;
  justify-content: center;
  padding: 1em;
  text-align: center;
}

/* === Product Info === */
.product-details {
  padding: 0rem;
  text-align: center;
}

.product-details h3 {
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  margin-bottom: 0.1rem;
  margin-top: 0;
}

.product-details p {
  font-size: clamp(0.85rem, 2vw, 1rem);
  padding: 0 2%;
  line-height: 1.6;
}


.product-details a {
  display: inline-block;
  margin-top: 0.3rem;
  text-decoration: none;
  color: #333;
  font-size: 0.9rem;
}
.product-details {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: 0 2%;
}

.animated-buy-button { margin-top: auto; }  /* CTA sticks to bottom of content */

@media (max-width: 360px){
  .product-details p{
    display: -webkit-box;
    -webkit-box-orient: vertical;
         /* optional: limit lines on very small screens */
    overflow: hidden;
  }
}

/* === Button Animation === */
.animated-buy-button {
  display: inline-block;
  position: relative;
  margin-top: 0.3rem;
  font-size: 0.9rem;
  text-decoration: none;
  color: #c09f67;
  animation: textPulse 2.5s ease-in-out infinite;
}

@keyframes textPulse {
  0%, 100% {
    opacity: 1;
    transform: translateY(0);
  }
  50% {
    opacity: 0.5;
    transform: translateY(-2px);
  }
}

/* Show More Button */
.show-more-button {
  display: none;
}
/* === Product Type Badge === */
/* === Base (desktop and tablet) === */
.product-type {
  position: absolute;
  top: 5%;
  left: 5%;
  padding: 0.25em 0.6em;
  font-size: clamp(0.7rem, 1.5vw, 0.85rem);
  font-weight: bold;
  color: #fff;
  background-color: rgba(192, 159, 103, 0.9);
  border-radius: 0.6em;
  z-index: 10;
  line-height: 1.2;
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

/* === Tablet down (≤1024px) === */
@media (max-width: 1024px) {
  .product-type {
    top: 4%;
    left: 4%;
    font-size: clamp(0.7rem, 2vw, 0.8rem);
    padding: 0.25em 0.55em;
  }
}

/* === Mobile (≤767px) === */
@media (max-width: 767px) {
  .product-type {
    top: 3.5%;
    left: 3.5%;
    font-size: clamp(0.65rem, 3vw, 0.75rem);
    padding: 0.2em 0.5em;
    border-radius: 0.5em;
    white-space: normal; /* allows wrapping if text is long */
    text-align: center;
  }
}

/* === Very narrow phones (≤360px) === */
@media (max-width: 360px) {
  .product-type {
    font-size: clamp(0.6rem, 3.5vw, 0.7rem);
    top: 3%;
    left: 3%;
    padding: 0.15em 0.45em;
  }
}

.product-price{
  margin: 0;
  padding: 0;
}
.product-type.cs{
  background-color: rgb(252, 171, 218);
}
.product-type.ch{
  background-color: rgb(144, 197, 250);
}
.product-type.mix{
  background-color: rgb(207, 156, 252);
}
/* ==========================
   GENERAL STYLING
========================== */
.sizeSelect {
  font-family: inherit;
  font-size: 14px;
  color: #333;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  appearance: none;
  cursor: pointer;
  padding: 2px 24px 2px 8px;
  line-height: 1.5;
  background-image:
    linear-gradient(45deg, transparent 50%, #555 50%), 
    linear-gradient(-45deg, transparent 50%, #555 50%);
  background-position:
    calc(100% - 14px) calc(50% - 3px), 
    calc(100% - 8px) calc(50% - 3px);
  background-size: 6px 6px;
  background-repeat: no-repeat;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.sizeSelect:focus {
  outline: none;
  border-color: #888;
  box-shadow: 0 0 2px rgba(0,0,0,0.25);
}

.sizeSelect option {
  padding: 2px 4px;
}

/* ==========================
   RESPONSIVE ADJUSTMENTS
========================== */
@media screen and (max-width: 600px) {
  .sizeSelect {
    font-size: 12px;
    padding: 2px 18px 2px 6px;
    background-position:
      calc(100% - 12px) calc(50% - 3px),
      calc(100% - 6px) calc(50% - 3px);
    background-size: 5px 5px;
  }
}
/* ==================================================
   #tips-slider Styles with Slant Clip Paths
================================================== */
#tips-slider {
  position: relative;
  text-align: center;
  font-family: 'Zen Old Mincho', serif;
  color: #fff;

  /* Main background */
  background-image: url('images/_DSC2915-min.jpg');
  background-size: cover;
  background-position: center;

  /* Fallback for gaps */
  background-color: #fff;

  /* ==================================================
     Final Clip Paths:
       Left slices: 0–5%, 7–12%, 14–19%
       Center area: 20–80%
       Right slices: 81–86%, 88–93%, 95–100%
  ================================================== */
  -webkit-mask-image:
    linear-gradient(#000 0 0),
    linear-gradient(#000 0 0),
    linear-gradient(#000 0 0),
    linear-gradient(#000 0 0),
    linear-gradient(#000 0 0),
    linear-gradient(#000 0 0),
    linear-gradient(#000 0 0);
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size:
    3.5% 100%,    /* Left Slice 1 */
    6% 100%,    /* Left Slice 2 */
    9% 100%,    /* Left Slice 3 */
    61.5% 100%,   /* Center */
    9% 100%,    /* Right Slice 1 */
    6% 100%,    /* Right Slice 2 */
    3.5% 100%;    /* Right Slice 3 */
  -webkit-mask-position:
   0% top,     /* Left Slice 1 */
    4% top,     /* Left Slice 2 */
    11% top,    /* Left Slice 3 */
    50% top,    /* Center Area */
    89% top,    /* Right Slice 1 */
    96% top,    /* Right Slice 2 */
    100% top;    /* Right Slice 3 */

  mask-image:
    linear-gradient(#000 0 0),
    linear-gradient(#000 0 0),
    linear-gradient(#000 0 0),
    linear-gradient(#000 0 0),
    linear-gradient(#000 0 0),
    linear-gradient(#000 0 0),
    linear-gradient(#000 0 0);
  mask-repeat: no-repeat;
  mask-size:
    3.5% 100%,    /* Left Slice 1 */
    6% 100%,    /* Left Slice 2 */
    9% 100%,    /* Left Slice 3 */
    61.5% 100%,   /* Center */
    9% 100%,    /* Right Slice 1 */
    6% 100%,    /* Right Slice 2 */
    3.5% 100%;    /* Right Slice 3 */
  mask-position:
   0% top,     /* Left Slice 1 */
    4% top,     /* Left Slice 2 */
    11% top,    /* Left Slice 3 */
    50% top,    /* Center Area */
    89% top,    /* Right Slice 1 */
    96% top,    /* Right Slice 2 */
    100% top;    /* Right Slice 3 */

  padding: 3rem 1rem;
}

#tips-slider::before {
  /* Semi-transparent overlay for text readability */
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.381);
  z-index: 1;
}

#tips-slider h2,
#tips-slider .tips-container,
#tips-slider .tips-buttons {
  position: relative;
  z-index: 2;
}

#tips-slider h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.tips-container {
  position: relative;
  overflow: hidden;
  max-width: 600px;
  margin: 0 auto;
}
.tips-container {
  max-width: 600px;
  margin: 0 auto;
  height: 160px; /* Adjust to fit tallest content */
  position: relative;
  overflow: hidden;
}

.tip-slide {
  min-width: 100%;
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 1rem;
  line-height: 1.6;
  transition: opacity 0.5s ease-in-out;
  text-align: center;
  padding: 0 1rem;
  box-sizing: border-box;
}


.tip-slide.active {
  position: relative;
  opacity: 1;
}

/* Buttons as navigation */
.tips-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0;
 
}
.tips-buttons button {
  font-size: 1rem;
  padding: 0.25rem 1rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  color: #383838;

  background: #f1d39aa3;
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.tips-buttons button:hover {
  background: #e3b36b;
  transform: translateY(-2px);
  box-shadow: 0px 0px 15px rgba(243, 194, 127, 0.5);
}
.tips-buttons button.active {
  background: #dba44a;
}
#tips-slider:hover {
  filter: brightness(1.1) saturate(1.2);
 
}
/* === Step 1: Basic slide-in drawer === */
.purchase-drawer { position: fixed; inset: 0; z-index: 9999; pointer-events: none; }
.purchase-drawer .drawer-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.35);
  opacity: 0; transition: opacity .25s ease;
}
.purchase-drawer .drawer-panel {
  position: absolute; top: 0; right: 0; height: 100%;
  width: 50vw; max-width: 560px; background: #fff;
  transform: translateX(100%); transition: transform .35s ease;
  box-shadow: -8px 0 24px rgba(0,0,0,.18);
}
.purchase-drawer.open { pointer-events: auto; }
.purchase-drawer.open .drawer-overlay { opacity: 1; }
.purchase-drawer.open .drawer-panel { transform: translateX(0); }

.drawer-close {
  position: absolute; top: 10px; right: 12px;
  width: 40px; height: 40px; border: 0; border-radius: 999px;
  font-size: 28px; line-height: 1; cursor: pointer; background: #f3f3f3; color: #333;
}
.drawer-close:hover { background: #e9e9e9; }

@media (max-width: 768px) {
  .purchase-drawer .drawer-panel { width: 85vw; max-width: none; }
}
.drawer-content {
  padding: 1rem 1.25rem;
  display: grid;
  gap: 1rem;
}

.drawer-brand {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .75rem;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  background: #fafafa;
}

.drawer-brand img {
  width: 120px;
  max-width: 40%;
  height: auto;
  object-fit: contain;
}

.drawer-links {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding-top: .25rem;
}

.drawer-links a {
  display: inline-block;
  padding: .5rem .75rem;
  border-radius: 8px;
  background: #f7f7f7;
  text-decoration: none;
  color: #333;
  transition: transform .2s ease, box-shadow .2s ease;
}

.drawer-links a:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

@media (max-width: 768px) {
  .drawer-brand img { width: 96px; }
}
