    :root {
      --brand-color: #004d40;
      --text-color: #333;
      --radius: 8px;
      --card-image-min: 400px;
      --card-image-max: 420px;
      --tagline-lines: 2;
      --line-height: 1.4;
    }
	
/* Prevent layout jump + fade-in effect */
#adContainer {
    opacity: 0;
    transition: opacity 0.35s ease-in-out;
    min-height: 700px; /* adjust to match your grid */
}

/* Applied by JS when DOM is ready */
#adContainer.loaded {
    opacity: 1;
}


#showcase {
    min-height: 400px; /* or whatever height fits your grid */
    opacity: 0;
    transition: opacity 0.3s ease;
}

#showcase.loaded {
    opacity: 1;
}

    body {
      font-family: Arial, sans-serif;
      background: var(--brand-color);
      margin: 0;
      padding: 16px;
      text-align: center;
      color: var(--text-color);
    }

    h1 {
      color: white;
    }

    .branding-block {
      background: var(--brand-color);
      color: #fff;
      padding: 1rem;
      border-radius: var(--radius);
      margin-bottom: 1.5rem;
    }

    .container {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
      gap: 20px;
      align-items: stretch;
      margin-top: 20px;
    }

    .ad {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      border: 1px inset #999;
      padding: 16px;
      background-color: #fdfdfd;
      border-radius: var(--radius);
      text-align: center;
      transition: transform 0.2s ease, box-shadow 0.2s ease;
      box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }
    .ad:hover {
      transform: translateY(-5px);
      box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    }

    .ad img {
      width: 100%;
      min-height: var(--card-image-min);
      max-height: var(--card-image-max);
      object-fit: cover;
      border-radius: 4px;
      margin-bottom: 10px;
    }

    .tagline {
      font-style: italic;
      color: #555;
      margin-bottom: 10px;
      display: -webkit-box;
      -webkit-line-clamp: var(--tagline-lines);
      -webkit-box-orient: vertical;
      overflow: hidden;
      line-height: var(--line-height);
      min-height: calc(var(--line-height) * 1em * var(--tagline-lines));
      text-align: center;
    }

    .btnGroup {
      margin-top: auto;
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
    }

    .buyBtn {
      background: linear-gradient(135deg, #4CAF50, #2e7d32);
      color: white;
      border: none;
      padding: 10px 20px;
      font-size: 15px;
      font-weight: bold;
      cursor: pointer;
      border-radius: 6px;
      margin: 6px;
      box-shadow: 0 4px 6px rgba(0,0,0,0.2);
      transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
    }
    .buyBtn:hover {
      background: linear-gradient(135deg, #43a047, #1b5e20);
      transform: translateY(-3px);
      box-shadow: 0 6px 10px rgba(0,0,0,0.25);
    }
    .buyBtn:active {
      transform: scale(0.95);
      box-shadow: 0 3px 6px rgba(0,0,0,0.2);
    }

    /* Modal */
    .modal {
      display: none;
      position: fixed;
      z-index: 999;
      left: 0; top: 0;
      width: 100%; height: 100%;
      background: rgba(0,0,0,0.6);
      justify-content: center;
      align-items: center;
    }
    .modal-content {
      background: #fff;
      padding: 20px;
      border-radius: var(--radius);
      max-width: 520px;
      text-align: center;
      box-shadow: 0 6px 12px rgba(0,0,0,0.3);
      animation: fadeIn 0.25s ease;
    }
    .modal h2 {
      margin-top: 0;
      color: var(--brand-color);
    }
    .closeBtn {
      background: #ccc;
      border: none;
      padding: 8px 16px;
      border-radius: 6px;
      cursor: pointer;
      margin-top: 15px;
    }
    .closeBtn:hover {
      background: #aaa;
    }
    @keyframes fadeIn {
      from {opacity: 0; transform: scale(0.96);}
      to {opacity: 1; transform: scale(1);}
    }

    /* Mobile adjustments */
    @media (max-width: 600px) {
      .container { grid-template-columns: 1fr; gap: 16px; }
      h1 { font-size: 1.4rem; }
      h3 { font-size: 1.1rem; }
      .ad img { max-height: 180px; }
    }

    @media (max-width: 480px) {
      .btnGroup {
        flex-direction: column;
        align-items: stretch;
      }
      .buyBtn {
        width: 100%;
        margin: 10px 0;
        padding: 14px 22px;   /* larger tap target */
        font-size: 16px;
        transition: background 0.3s ease, transform 0.15s ease;
      }
      .buyBtn:active {
        background: linear-gradient(135deg, #388e3c, #1b5e20); /* darker shade on tap */
        transform: scale(0.97); /* subtle shrink feedback */
      }
      .modal-content {
        width: 90%;
        max-width: 400px;
      } 
}