  * {
      box-sizing: border-box;
  }

  body {

      margin: 0;
      padding: 20px;
  }

  main {
      display: flex;
      justify-content: center;

      margin: auto;
      width: 800px;
      max-width: 95%;
  }

  .meta {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 10px;
      gap: 20px;
  }






  section {
      width: 100%;
      padding: 10px;
      background-color: white;
      border-radius: 10px;
      border: 1px solid #ccc;
      box-shadow: 0px 0px 15px 0px rgba(0, 0, 0, 0.1);
  }


  article {
      background: #fff;
      border-radius: 16px;
      border: 1px solid #eee;
      box-shadow: 0px 0px 2px 0px #000000;
      overflow: hidden;
      transition: transform 0.2s ease;
      margin: 5px 0 5px 0;
      transition: all .3s ease;

  }

  article:hover {
      transform: translateY(-8px);
      box-shadow: 0 20px 45px rgba(0, 0, 0, .15);
  }

  article:hover h3 {
      color: var(--primary);
  }

  article img {
      transition: transform .4s ease;
  }

  article:hover img {
      transform: scale(1.08);
  }

  article a {
      text-decoration: none;
      color: black;
      display: flex;

      align-items: center;

      padding: 15px;
      gap: 20px;

  }


  .img-container {
      flex-shrink: 0;
      width: 100px;
      height: 100px;
      border-radius: 8px;
      overflow: hidden;

  }

  #message {
      resize: none;
      width: 100%;
      height: 150px;
  }

  #user-message {
      display: flex;
      gap: 10px;
  }

  #user-message input,
  #user-message button {
      width: 100%;

      margin: 3px;
  }

  #user-message label {
      font-size: 16px;
  }


  hr {
      border: none;
      height: 1px;
      background: rgba(0, 0, 0, 0.315);
      box-shadow: 0 0 12px rgba(59, 130, 246, .35);

  }

  .cart-panel {
      display: none;
      position: absolute;
      top: 100%;
      left: 0;
      /* به‌جای right: 0 */
      width: 280px;
      background: white;
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      box-shadow: 0 12px 24px -12px rgba(0, 0, 0, 0.35);
      z-index: 100;
      margin-top: 5px;
  }

  .cart-header {
      padding: 8px 12px;
      font-weight: bold;
      border-bottom: 1px solid #e2e8f0;
  }

  .cart-list {
      max-height: 300px;
      /* اندازه ثابت */
      overflow-y: auto;
      /* اسکرول به جای بزرگ شدن */
      padding: 5px;
  }

  .cart-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 6px;
      border-bottom: 1px solid #e2e8f0;
  }

  .cart-item img {
      width: 32px;
      height: 32px;
      border-radius: 4px;
      object-fit: cover;
  }

  .cart-item a {
      flex: 1;
      text-decoration: none;
      color: inherit;
  }

  .cart-item .remove-btn {
      cursor: pointer;
      border: none;
      background: none;
      color: #db0001;
      font-size: 16px;
  }

  .btn-checkout {
      color: var(--TextColor);
      width: 100%;
      padding: 8px;
      border: none;
      background-color: var(--primary);
      color: white;
      border-radius: 0 0 8px 8px;
      cursor: pointer;
  }


  .img-container img {
      width: 100%;
      height: 100%;
      object-fit: cover;

      object-position: center;

      display: block;

  }


  .text-content {
      flex-grow: 1;

      display: flex;
      flex-direction: column;
      justify-content: center;
  }

  .text-content h3 {
      margin: 0 0 5px 0;
      font-size: 28px;
      color: #000000;
  }

  .text-content p {
      margin: 0;
      font-size: 20px;
      color: #000000;
      

  }

  a {
      text-decoration: none;
      color: blue;
  }

  button {
      text-decoration: none;

      font-size: 20px;

      cursor: pointer;

  }

  .btn-page {

      width: 100%;
  }



  img {
      display: block;
      margin-left: auto;
      margin-right: auto;
  }


  #searchbox {
      display: flex;


  }

  #searchbox input {
      width: 100%;

      border-radius: 3px;



  }

  #searchbox input,
  #searchbox select {
      box-shadow:
          0 2px 6px rgba(0, 0, 0, 0.12),
          0 0 1px rgba(0, 0, 0, 0.2);

      font-size: 19px;

  }

  #searchbox input,
  #searchbox button,
  #searchbox select {
      margin: 10px;


  }

  button {
      padding: 10px;
  }
  #tag{
    display: none;
  }
  @media (max-width: 768px) {

        article {
        border-radius: 12px;
        overflow: visible; /* به‌جای hidden — تا .meta هیچ‌وقت به خاطر سرریزِ محتوا قطع/مخفی نشه */
    }


      button {
          width: 100%;
      }

      /* مشکل ۱: دکمه حذف رو از قانون عمومی مستثنی کن */
      button:not(.remove-btn) {
          width: 100%;
      }

      .remove-btn {
          width: auto;
          flex-shrink: 0;
          padding: 4px 8px;
      }

      .cart-panel {
          width: min(300px, calc(100vw - 20px));
          max-width: 320px;
          left: 0;
          /* به‌جای right: 0 */
          top: 100%;
      }

      .cart-item {
          gap: 6px;
          padding: 8px 4px;
      }

      .cart-item img {
          width: 40px;
          height: 40px;
      }

      .cart-item a {
          font-size: 14px;
      }

      .cart-header,
      #cartCount {
          font-size: 15px;
      }

      .btn-checkout {
          font-size: 15px;
          padding: 12px;
      }

      body {
          padding: 10px;
      }

      main {
          margin: 0;
          width: 100%;
          max-width: 100%;
      }

      /* --- چیدمان جدید کارت‌ها: تیتر / عکس تمام‌عرض / متن / meta --- */

      article a {
        flex-direction: column;
        align-items: stretch;
        text-align: right;
        padding: 0;
        gap: 0;
        overflow: hidden; /* گردیِ گوشه‌ها اینجا حفظ می‌شه، بدون اینکه محتوا رو قطع کنه چون ارتفاعش auto هست */
        border-radius: 12px;
    }

    article .text-content {
        display: contents;
    }

    article h3 {
        order: 1;
        text-align: right;
        padding: 10px 10px 0 10px;
        font-size: 20px;
        margin: 0;
    }

    .img-container {
        order: 2;
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 9;
        border-radius: 0;
    }

    .img-container img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    article p {
        order: 3;
        padding: 10px;
        font-size: 15px;
        text-align: right;
        margin: 0;

        /* جلوگیری از سرریزِ افقی کلمه‌ی بلند که باعث می‌شد .meta بعدش قطع بشه */
        overflow-wrap: break-word;
        word-break: break-word;

        /* محدود کردن به ۲ خط، تا کارت‌ها بی‌رویه بلند نشن */
        display: -webkit-box;
   
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    article .meta {
        order: 4;
        display: flex;
        direction: ltr;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        padding: 0 10px 10px 10px;
        flex-shrink: 0; /* هیچ‌وقت جمع یا مخفی نشه */
        min-width: 0;
    }

    article .meta span {
        text-align: right;
        min-width: 0;
        overflow-wrap: break-word;
    }

    article .meta span:first-child {
        text-align: left;
    }

      /* --- سرچ‌باکس --- */

      #searchbox input,
      #searchbox button,
      #searchbox select {
          width: 100%;
          /* کاهش فاصله افقی */
          font-size: 18px;
          gap: 10px;
      }

      /* حذف سایه‌های سنگین اگر روی عملکرد تاثیر دارد (اختیاری) */
      #searchbox input,
      #searchbox select {
          box-shadow: none;
          /* سایه سیاه ممکن است در موبایل زشت باشد */
          border: 1px solid #ccc;
          /* اضافه کردن بردر برای دیدن کادر */
      }
  }

  :root {
      --text: #000000;
      --shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
      --shadow-hover: 0 10px 25px rgba(15, 23, 42, 0.12);
      --radius: 14px;

      --card: #ffffff;



      --primary-dark: color-mix(in srgb, var(--primary) 80%, black);
  }


  body {
      margin: 0;
      padding: 0;
      background: var(--color);
      color: var(--text);
      line-height: 1.6;
  }


  section,
  article {
      background: #ffffff;
      border: 1px solid #e2e8f0;
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      transition: all .25s ease;
      overflow: hidden;
  }


  article:hover {
      transform: translateY(-4px);
      box-shadow: var(--shadow-hover);
      border-color: #c7d2fe;
  }


  h1,
  h2,
  h3 {
      color: var(--text);
      margin: 0 0 10px;
  }

  p {
      color: var(--text);
      margin: 0 0 10px;
  }


  button,
  .btn {
      color: var(--TextColor);
      background: var(--primary);
      border: none;
      padding: 10px 16px;
      border-radius: 10px;
      cursor: pointer;
      font-weight: 500;
      transition: 0.2s ease;
      box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  }

  button:hover,
  .btn:hover {
      background: var(--primary-dark);
      transform: translateY(-2px);
  }

  /* 🔍 فرم جستجو */
  input,
  select,
  textarea {

      padding: 10px 12px;
      border-radius: 10px;
      border: 1px solid #e2e8f0;
      background: #fff;
      color: var(--text);
      outline: none;
      transition: 0.2s ease;
  }

  input:focus,
  select:focus,
  textarea:focus {

      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  }

 

  /* 📜 اسکرول ساده (سازگار قدیمی) */
  ::-webkit-scrollbar {
      width: 8px;
  }

  ::-webkit-scrollbar-track {
      background: #f1f5f9;
  }

  ::-webkit-scrollbar-thumb {
      background: var(--primary);
  }




  /*Scroll*/
  :root {
      --topbar-height: 30px;
  }

  #msg {
      background-color: var(--primary);
      color: var(--TextColor);
      width: 100%;
      overflow: hidden;
      position: fixed;
      top: 0;
      left: 0;
      height: var(--topbar-height);
      line-height: var(--topbar-height);
      z-index: 9999;
  }

  body {
      padding-top: var(--topbar-height);
  }


  main {
      margin-top: 15px;
  }



  .scroll {
      animation: scroll 20s linear infinite;
      display: inline-block;
      white-space: nowrap;
      padding-left: 100%;
  }

  @keyframes scroll {
      from {
          transform: translateX(10%);
      }

      to {
          transform: translateX(-100%);
      }
  }






  article {
      opacity: 0;
      transform: translateY(40px) scale(.96);
      animation: cardLoad .7s ease forwards;
  }

  article:nth-child(1) {
      animation-delay: .05s;
  }

  article:nth-child(2) {
      animation-delay: .10s;
  }

  article:nth-child(3) {
      animation-delay: .15s;
  }

  article:nth-child(4) {
      animation-delay: .20s;
  }

  article:nth-child(5) {
      animation-delay: .25s;
  }

  article:nth-child(6) {
      animation-delay: .30s;
  }

  article:nth-child(7) {
      animation-delay: .35s;
  }

  article:nth-child(8) {
      animation-delay: .40s;
  }

  article:nth-child(9) {
      animation-delay: .45s;
  }

  article:nth-child(10) {
      animation-delay: .50s;
  }

  @keyframes cardLoad {
      0% {
          opacity: 0;
          transform: translateY(40px) scale(.96);
      }

      60% {
          opacity: 1;
      }

      100% {
          opacity: 1;
          transform: translateY(0) scale(1);
      }
  }

  .img-container {
      position: relative;
      overflow: hidden;
  }

  .img-container::before {
      content: "";
      position: absolute;
      top: 0;
      left: -150%;
      width: 80%;
      height: 100%;
      background: linear-gradient(90deg,
              transparent,
              rgba(255, 255, 255, .6),
              transparent);
      animation: shine 2.5s infinite;
  }

  @keyframes shine {
      to {
          left: 250%;
      }
  }