  /* Global Layout Reset for Full Screen */
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

/* ========================================
   Font Awesome Global Icons - FORCE DISPLAY
   ======================================== */
/* Override @font-face paths to use absolute URLs */
@font-face {
  font-family: "Font Awesome 6 Free";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url('/vendor/fontawesome/webfonts/fa-regular-400.woff2') format("woff2"),
       url('/vendor/fontawesome/webfonts/fa-regular-400.ttf') format("truetype");
}

@font-face {
  font-family: "Font Awesome 6 Free";
  font-style: normal;
  font-weight: 900;
  font-display: block;
  src: url('/vendor/fontawesome/webfonts/fa-solid-900.woff2') format("woff2"),
       url('/vendor/fontawesome/webfonts/fa-solid-900.ttf') format("truetype");
}

#main-footer {
    --footer-bg: radial-gradient(circle at top left, rgba(68, 97, 255, 0.25), rgba(4, 11, 26, 0.95));
    --footer-card-bg: rgba(8, 14, 31, 0.7);
    --footer-border: rgba(255, 255, 255, 0.1);
    --footer-text: #d8e7ff;
    --footer-muted: #97a3c0;
    background: var(--footer-bg);
    color: var(--footer-text);
    position: relative;
    overflow: hidden;
    margin-top: clamp(3rem, 6vw, 6rem);
    isolation: isolate;
  }

  #main-footer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(87, 150, 255, 0.25), transparent 45%),
      radial-gradient(circle at 80% 0%, rgba(255, 84, 146, 0.2), transparent 35%);
    opacity: 0.65;
    z-index: -2;
  }

  .footer-container {
    width: min(1200px, calc(100vw - 3rem));
    margin-inline: auto;
    padding: clamp(2.5rem, 4vw, 4rem) 0 clamp(2rem, 3vw, 3.25rem);
  }

  .footer-inner {
    display: flex;
    flex-direction: column;
    gap: clamp(2rem, 4vw, 3.5rem);
  }

  .footer-spotlight {
    background: linear-gradient(125deg, rgba(12, 22, 52, 0.95), rgba(23, 34, 64, 0.85));
    border: 1px solid var(--footer-border);
    border-radius: 28px;
    padding: clamp(1.8rem, 3vw, 2.75rem);
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
    gap: clamp(1.5rem, 4vw, 2.75rem);
    box-shadow: 0 25px 65px rgba(1, 5, 14, 0.65);
  }

  .footer-spotlight__content {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    padding: 0.5rem 0.5rem 0.5rem 0.75rem;
  }

  .footer-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: rgba(99, 179, 255, 0.15);
    border: 1px solid rgba(99, 179, 255, 0.3);
    font-size: 0.85rem;
    color: #8dc6ff;
    letter-spacing: 0.02em;
  }

  .footer-spotlight__heading {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    margin: 0;
    color: #f7fbff;
  }

  .footer-spotlight__description {
    margin: 0;
    color: var(--footer-muted);
    font-size: 1rem;
  }

  .footer-logo-wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .footer-logo-wrap img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .footer-logo-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 0.2rem 0;
  }

  .footer-logo-caption {
    margin: 0;
    color: var(--footer-muted);
    font-size: 0.9rem;
  }

  .footer-tts-btn {
    margin-left: auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.06);
    color: #7bc9ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, border-color 0.2s ease;
  }

  .footer-tts-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.6);
  }

  .footer-contact-block {
    background: rgba(11, 19, 42, 0.7);
    border-radius: 18px;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--footer-border);
  }

  .footer-contact-title {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    color: #f7fbff;
  }

  .footer-contact-list p {
    margin: 0 0 0.35rem 0;
    color: var(--footer-muted);
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .footer-contact-list i {
    color: #7bc9ff;
    width: 16px;
  }

  .footer-pill-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
  }

  .footer-pill {
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.2);
  }

  .footer-pill strong {
    display: block;
    font-size: 0.95rem;
    color: #fefefe;
  }

  .footer-pill span {
    font-size: 0.82rem;
    color: var(--footer-muted);
  }

  .footer-form {
    display: flex;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 999px;
    padding: 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .footer-form input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--footer-text);
    padding: 0.75rem 1.1rem;
    font-size: 0.95rem;
  }

  .footer-form input::placeholder {
    color: rgba(255, 255, 255, 0.5);
  }

  .footer-form button {
    border: none;
    border-radius: 999px;
    padding: 0.65rem 1.5rem;
    background: linear-gradient(120deg, #35c6d8, #169fcb);
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
  }

  .footer-form button:hover {
    transform: translateY(-1px);
  }

  .footer-spotlight__visual {
    display: flex;
    align-items: stretch;
    justify-content: center;
  }

  .footer-mascot-card {
    width: 100%;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(160deg, rgba(16, 24, 61, 0.85), rgba(62, 25, 76, 0.8));
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
  }

  .footer-mascot-card::after {
    content: '';
    position: absolute;
    inset: 10% auto -20% -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 70%);
    transform: rotate(25deg);
  }

  .footer-mascot-card h3 {
    margin: 0.25rem 0 0.35rem 0;
    color: #fff;
  }

  .footer-mascot-label {
    margin: 0;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
  }

  .footer-mascot-card p {
    margin: 0;
    color: var(--footer-muted);
  }

  .footer-mascot-meta {
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
  }

  .footer-mascot-meta span {
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
  }

  .footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: clamp(1rem, 3vw, 1.75rem);
  }

  .footer-card {
    background: var(--footer-card-bg);
    border-radius: 20px;
    border: 1px solid var(--footer-border);
    padding: 1.5rem;
    min-height: 100%;
  }

  .footer-card-title {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #f3f7ff;
  }

  .footer-card-subtitle {
    margin: -0.25rem 0 0.9rem 0;
    color: var(--footer-muted);
    font-size: 0.9rem;
  }

  .footer-link-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }

  .footer-link-list a {
    text-decoration: none;
    color: var(--footer-muted);
    font-size: 0.92rem;
    transition: color 0.2s ease;
  }

  .footer-link-list a:hover {
    color: #9cd4ff;
  }

  .footer-socials__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
    gap: 0.75rem;
  }

  .footer-socials__grid a {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
  }

  .footer-socials__grid a:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.4);
  }

  .footer-contact-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .footer-social-inline {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem;
  }

  .footer-social-inline a {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #1f2e6b, #2d89ff);
  }

  .footer-app-download {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 18px;
    padding: 1rem;
    border: 1px dashed rgba(255, 255, 255, 0.2);
  }

  .footer-app-download-title {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: var(--footer-muted);
  }

  .footer-app-download-grid {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .footer-app-download-item {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    color: var(--footer-text);
  }

  .footer-app-download-item canvas {
    width: 104px;
    height: 104px;
    border-radius: 16px;
    background: #fff;
  }

  .footer-app-download-label {
    font-size: 0.85rem;
  }

  .footer-contact-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin-inline: auto;
    padding: 0.6rem 1.5rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    text-decoration: none;
    transition: background 0.2s ease;
  }

  .footer-contact-link:hover {
    background: rgba(255, 255, 255, 0.08);
  }

  .footer-badges-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
  }

  .footer-badge-card {
    min-height: 160px;
  }

  #main-footer .badge-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  #main-footer .badge-tile {
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.82rem;
    color: var(--footer-muted);
  }

  .footer-divider {
    height: 1px;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
  }

  .footer-bottom {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
  }

  .footer-bottom__primary {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
  }

  .footer-copy {
    margin: 0;
    color: var(--footer-muted);
    font-size: 0.92rem;
  }

  .footer-legal-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
  }

  .footer-legal-links a {
    color: #9cd4ff;
    text-decoration: none;
    font-size: 0.88rem;
  }

  .footer-bottom__meta {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.78rem;
  }

  .footer-scroll-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    border: none;
    background: linear-gradient(135deg, #63b3ff, #3a7dff);
    color: #fff;
    box-shadow: 0 18px 30px rgba(8, 27, 64, 0.35);
    display: none;
    z-index: 1000;
    cursor: pointer;
  }

  .footer-scroll-top i {
    font-size: 1.25rem;
  }

  .footer-scroll-top:hover {
    transform: translateY(-2px);
  }

  @media (max-width: 991.98px) {
    #main-footer .footer-spotlight {
      grid-template-columns: 1fr;
    }

    #main-footer .footer-form {
      flex-direction: column;
      border-radius: 24px;
    }

    #main-footer .footer-form button {
      width: 100%;
    }

    #main-footer .footer-bottom__primary {
      flex-direction: column;
      align-items: flex-start;
    }
  }

  @media (max-width: 768px) {
    #main-footer .footer-grid {
      grid-template-columns: 1fr;
    }

    #main-footer .footer-badges-row {
      grid-template-columns: 1fr;
    }

    #main-footer .footer-card,
    #main-footer .footer-contact-card {
      text-align: left;
    }
  }

  @media (max-width: 575.98px) {
    #main-footer .footer-container {
      width: calc(100vw - 1.5rem);
    }

    #main-footer .footer-logo-wrap {
      flex-direction: column;
      align-items: flex-start;
    }

    #main-footer .footer-pill-stats {
      grid-template-columns: 1fr;
    }

    #main-footer .footer-socials__grid {
      grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
    }
  }

    :root {
      --header-text-color: #2c3e50;
      --header-bg-color: #ffffff;
      --header-border-color: #e8ecef;
      --search-focus-color: #2c3e50;
      --primary-accent: #2c3e50;
      --secondary-accent: #34495e;
      --gradient-primary: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
      --gradient-secondary: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
      --shadow-light: 0 2px 10px rgba(0,0,0,0.08);
      --shadow-medium: 0 4px 20px rgba(0,0,0,0.12);
      --shadow-heavy: 0 8px 30px rgba(0,0,0,0.15);
    }

    /* ===== MODERN BLOG SECTION STYLES ===== */
    .modern-blog-section {
        padding: 4rem 0;
        background: linear-gradient(135deg, #ecf0f1 0%, #ffffff 50%, #f8f9fa 100%);
        position: relative;
        overflow: hidden;
    }

    .modern-blog-section::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background:
            radial-gradient(circle at 20% 80%, rgba(44, 62, 80, 0.08) 0%, transparent 50%),
            radial-gradient(circle at 80% 20%, rgba(52, 73, 94, 0.1) 0%, transparent 50%);
        pointer-events: none;
    }

    .blog-section-header {
        text-align: center;
        margin-bottom: 4rem;
        position: relative;
        z-index: 2;
    }

    .section-badge {
        display: inline-block;
        background: rgba(44, 62, 80, 0.15);
        backdrop-filter: blur(20px);
        border: 1px solid rgba(44, 62, 80, 0.3);
        padding: 0.75rem 1.5rem;
        border-radius: 50px;
        font-size: 1rem;
        font-weight: 600;
        color: #2c3e50;
        margin-bottom: 1.5rem;
        letter-spacing: 0.5px;
    }

    .section-title {
        font-size: 3.5rem !important;
        font-weight: 800 !important;
        color: #333 !important;
        margin-bottom: 1rem !important;
        letter-spacing: -1px !important;
    }

    .section-subtitle {
        font-size: 1.2rem;
        color: #374151;
        max-width: 600px;
        margin: 0 auto;
        line-height: 1.6;
    }

    .blog-cards-container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
        gap: 2.5rem;
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 2rem;
        position: relative;
        z-index: 2;
    }

    .modern-blog-card {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        border-radius: 24px;
        overflow: hidden;
        box-shadow:
            0 20px 40px rgba(0, 0, 0, 0.1),
            0 0 0 1px rgba(255, 255, 255, 0.2);
        transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
        opacity: 0;
        transform: translateY(30px);
        animation: fadeInUp 0.8s ease forwards;
        position: relative;
    }

    @keyframes fadeInUp {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .modern-blog-card:hover {
        transform: translateY(-15px) scale(1.02);
        box-shadow:
            0 30px 60px rgba(0, 0, 0, 0.15),
            0 0 0 1px rgba(255, 255, 255, 0.3);
    }

    .card-image-container {
        position: relative;
        height: 240px;
        overflow: hidden;
        background: linear-gradient(45deg, #dbeafe, #bfdbfe);
    }

    .card-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
        filter: brightness(1.1) saturate(1.2);
    }

    .modern-blog-card:hover .card-image {
        transform: scale(1.1) rotate(1deg);
        filter: brightness(1.2) saturate(1.3);
    }

    .image-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(
            135deg,
            rgba(59, 130, 246, 0.8) 0%,
            rgba(96, 165, 250, 0.8) 100%
        );
        opacity: 0;
        transition: all 0.4s ease;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .modern-blog-card:hover .image-overlay {
        opacity: 1;
    }

    .quick-read-btn {
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(20px);
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 50%;
        width: 60px;
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 1.5rem;
        transition: all 0.3s ease;
        cursor: pointer;
        transform: scale(0.8);
    }

    .modern-blog-card:hover .quick-read-btn {
        transform: scale(1);
        background: rgba(255, 255, 255, 0.3);
        border-color: rgba(255, 255, 255, 0.5);
    }

    .category-tag {
        position: absolute;
        top: 1rem;
        left: 1rem;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        padding: 0.5rem 1rem;
        border-radius: 20px;
        font-size: 0.85rem;
        font-weight: 600;
        color: #1e40af;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }

    .card-content {
        padding: 2rem;
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .content-header {
        flex-grow: 1;
        margin-bottom: 1.5rem;
    }

  .modern-blog-card .card-title {
    font-size: 14px !important;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.3;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

    .card-excerpt {
        color: #6c757d;
        font-size: 1rem;
        line-height: 1.6;
        display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .content-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        margin-top: auto;
    }

    .author-info {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        flex: 1;
    }

    .author-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: linear-gradient(135deg, #3b82f6, #60a5fa);
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-weight: 600;
        font-size: 1rem;
    }

    .author-details {
        flex: 1;
    }

    .author-name {
        display: block;
        font-weight: 600;
        color: #2c3e50;
        font-size: 0.9rem;
    }

    .publish-date {
        display: block;
        color: #6c757d;
        font-size: 0.85rem;
        margin-top: 0.25rem;
    }

    .card-actions {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .action-btn {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: #f8f9fa;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #6c757d;
        transition: all 0.3s ease;
        cursor: pointer;
    }

    .action-btn:hover {
        background: #3b82f6;
        color: white;
        transform: scale(1.1);
    }

    .action-btn.bookmarked {
        background: #ffd700;
        color: white;
    }

    .primary-read-btn {
        background: linear-gradient(135deg, #3b82f6, #60a5fa);
        color: white;
        border: none;
        padding: 0.75rem 1.5rem;
        border-radius: 25px;
        font-weight: 600;
        font-size: 0.9rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        transition: all 0.3s ease;
        cursor: pointer;
        box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    }

    .primary-read-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
        background: linear-gradient(135deg, #1e40af, #3b82f6);
    }

    .section-footer {
        text-align: center;
        margin-top: 4rem;
        position: relative;
        z-index: 2;
    }

    .modern-cta-button {
        display: inline-flex;
        align-items: center;
        gap: 0.75rem;
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(20px);
        border: 2px solid rgba(255, 255, 255, 0.3);
        color: white;
        padding: 1rem 2rem;
        border-radius: 50px;
        font-weight: 600;
        font-size: 1.1rem;
        text-decoration: none;
        transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
        position: relative;
        overflow: hidden;
    }

    .modern-cta-button::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s ease;
    }

    .modern-cta-button:hover {
        transform: translateY(-3px);
        background: rgba(255, 255, 255, 0.25);
        border-color: rgba(255, 255, 255, 0.5);
        color: white;
        text-decoration: none;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    }

    .modern-cta-button:hover::before {
        left: 100%;
    }

    .button-icon {
        transition: transform 0.3s ease;
    }

    .modern-cta-button:hover .button-icon {
        transform: translateX(5px);
    }

    /* Empty States */
    .empty-blog-state,
    .error-state {
        text-align: center;
        padding: 4rem 2rem;
        color: white;
    }

    .empty-icon,
    .error-icon {
        font-size: 4rem;
        margin-bottom: 1rem;
        opacity: 0.8;
    }

    .empty-blog-state h3,
    .error-state h3 {
        font-size: 2rem;
        font-weight: 700;
        margin-bottom: 1rem;
        color: white;
    }

    .empty-blog-state p,
    .error-state p {
        font-size: 1.1rem;
        opacity: 0.9;
        max-width: 500px;
        margin: 0 auto;
    }

    /* Toast Notification */
    .modern-toast {
        position: fixed;
        bottom: 2rem;
        right: 2rem;
        background: rgba(0, 0, 0, 0.9);
        color: white;
        padding: 1rem 1.5rem;
        border-radius: 12px;
        font-weight: 500;
        transform: translateY(100px);
        opacity: 0;
        transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
        z-index: 10000;
        backdrop-filter: blur(20px);
    }

    .modern-toast.show {
        transform: translateY(0);
        opacity: 1;
    }

    /* Responsive Design */
    @media (max-width: 1200px) {
        .blog-cards-container {
            grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
            gap: 2rem;
        }
    }

    @media (max-width: 768px) {
        .modern-blog-section {
            padding: 3rem 0;
        }

        .section-title {
            font-size: 2.5rem;
        }

        .blog-cards-container {
            grid-template-columns: 1fr;
            gap: 1.5rem;
            padding: 0 1rem;
        }

        .card-image-container {
            height: 200px;
        }

        .card-content {
            padding: 1.5rem;
        }

        .modern-cta-button {
            font-size: 1rem;
            padding: 0.875rem 1.75rem;
        }
    }

    @media (max-width: 480px) {
        .section-title {
            font-size: 2rem;
        }

        .section-subtitle {
            font-size: 1rem;
        }

        .modern-blog-card {
            margin: 0 0.5rem;
        }

        .card-content {
            padding: 1.25rem;
        }

        .content-footer {
            flex-direction: column;
            align-items: stretch;
            gap: 1rem;
        }

        .card-actions {
            justify-content: center;
        }
    }

    .blog-card .badge {
        position: absolute;
        top: -0.75rem;
        left: 1.75rem;
        background: linear-gradient(135deg, #3498db, #2980b9);
        color: white;
        font-size: 0.75rem;
        font-weight: 600;
        padding: 0.5rem 1rem;
        border-radius: 25px;
        border: 3px solid white;
        box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
        z-index: 2;
    }

  .blog-card .card-title {
    font-size: 14px !important;
    font-weight: 700;
    line-height: 1.35;
    margin: 1rem 0 0.75rem 0;
    color: #2c3e50;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-clamp: 2;
  -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
  }

    .blog-card .card-title a {
        color: inherit;
        text-decoration: none;
        transition: color 0.3s ease;
        display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .blog-card .card-title a:hover {
        color: #3498db;
    }

    .blog-card .card-text {
        font-size: 0.95rem;
        line-height: 1.7;
        color: #6c757d;
        margin-bottom: 1.5rem;
        display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        flex-grow: 1;
    }

    .blog-card .card-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
        align-items: center;
        font-size: 0.85rem;
        color: #95a5a6;
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }

    .blog-card .card-meta i {
        color: #3498db;
        margin-right: 0.25rem;
    }

    .blog-card .btn {
        background: linear-gradient(135deg, #3498db, #2980b9);
        border: none;
        color: white;
        font-weight: 600;
        padding: 0.75rem 2rem;
        border-radius: 50px;
        transition: all 0.3s ease;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-size: 0.85rem;
        align-self: flex-start;
        margin-top: auto;
    }

    .blog-card .btn:hover {
        background: linear-gradient(135deg, #2980b9, #3498db);
        transform: translateX(4px);
        box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
        color: white;
    }

    /* View All Button Styling */
    .blog-grid .text-center {
        grid-column: 1 / -1;
        margin-top: 2rem;
    }

    .blog-grid .text-center .btn {
        background: linear-gradient(135deg, #95a5a6, #7f8c8d);
        border: none;
        color: white;
        font-weight: 600;
        padding: 1rem 3rem;
        border-radius: 50px;
        font-size: 1rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        transition: all 0.3s ease;
        box-shadow: 0 6px 20px rgba(149, 165, 166, 0.3);
    }

    .blog-grid .text-center .btn:hover {
        background: linear-gradient(135deg, #7f8c8d, #95a5a6);
        transform: translateY(-2px);
        box-shadow: 0 10px 30px rgba(149, 165, 166, 0.4);
        color: white;
    }

    /* Section Title Enhancements for Blog */
    .homepage-section .homepage-section-title {
        background: transparent !important;
        color: #333 !important;
        padding: 1.5rem 2rem !important;
        border-radius: 12px;
        margin-bottom: 2rem !important;
        position: relative;
        overflow: hidden;
    }

    /* Homepage section title animation removed for cleaner look */

    @keyframes shine {
        0% { transform: translateX(-100%); }
        100% { transform: translateX(100%); }
    }

    /* Responsive Design */
    @media (max-width: 992px) {
        .homepage-section .blog-grid {
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 1.5rem;
        }

        .blog-card .card-img-top-wrapper {
            height: 200px;
        }

        .blog-card .card-body {
            padding: 1.5rem;
        }
    }

    @media (max-width: 768px) {
        .homepage-section .blog-grid {
            grid-template-columns: 1fr;
            gap: 1.5rem;
            padding: 1.5rem 0;
        }

        .blog-card .card-img-top-wrapper {
            height: 180px;
        }

    .blog-card .card-title {
      font-size: 14px !important;
      line-height: 1.35 !important;
    }

        .blog-card .card-text {
            font-size: 0.9rem;
            -webkit-line-clamp: 2;
            line-clamp: 2;
        }

        .blog-card .card-body {
            padding: 1.25rem;
        }

        .homepage-section .homepage-section-title {
            padding: 1.25rem 1.5rem !important;
            margin-bottom: 1.5rem !important;
        }
    }

    @media (max-width: 480px) {
        .blog-card .card-img-top-wrapper {
            height: 160px;
        }

        .blog-card .card-meta {
            font-size: 0.8rem;
            gap: 0.75rem;
        }

        .blog-card .btn {
            padding: 0.625rem 1.5rem;
            font-size: 0.8rem;
        }
    }

    /* ===== MODERN TOP BAR ===== */
    .top-bar {
      background: transparent;
      padding: 0.6rem 0;
      font-size: 0.875rem;
      border-bottom: none;
      box-shadow: none;
      position: relative;
      overflow: hidden;
      width: 100vw;
      margin-left: calc(-50vw + 50%);
      left: 0;
      z-index: 1000;
    }

    /* Shimmer animation removed for cleaner look */

    .top-bar .container.top-bar-full-width {
      display: flex;
      justify-content: space-between;
      align-items: center;
      position: relative;
      z-index: 1;
      width: 100%;
      max-width: 1400px;
      margin: 0 auto;
      padding: 0 2rem;
    }

    .top-bar .left-content {
      display: flex;
      align-items: center;
      gap: 2rem;
      flex: 1;
      justify-content: flex-start;
    }

    .top-bar .right-content {
      display: flex;
      align-items: center;
      gap: 1.5rem;
      flex: 1;
      justify-content: flex-end;
    }

    .top-bar .left-content span {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      color: rgba(255,255,255,0.9);
      font-weight: 400;
      transition: color 0.3s ease;
    }

    @media (max-width: 1200px) {
      .top-bar,
      .main-header-wrapper,
      .main-header-wrapper-v2,
      .main-nav {
        width: 100% !important;
        margin-left: 0 !important;
        left: auto !important;
      }
    }

    .top-bar .left-content span:hover {
      color: rgba(255,255,255,1);
    }

    .top-bar .left-content i {
      width: 16px;
      text-align: center;
      color: rgba(255,255,255,0.8);
    }

    .top-bar .right-content a {
      color: rgba(255,255,255,0.9);
      text-decoration: none;
      font-weight: 400;
      padding: 0.3rem 0.8rem;
      border-radius: 20px;
      transition: all 0.3s ease;
      white-space: nowrap;
    }

    .top-bar .right-content a:hover {
      color: white;
      background: rgba(255,255,255,0.1);
      transform: translateY(-1px);
    }

    .top-bar .dropdown button {
      background: rgba(255,255,255,0.1);
      border: 1px solid rgba(255,255,255,0.2);
      color: white;
      padding: 0.3rem 0.8rem;
      border-radius: 15px;
      font-weight: 500;
      transition: all 0.3s ease;
    }

    .top-bar .dropdown button:hover {
      background: rgba(255,255,255,0.2);
      border-color: rgba(255,255,255,0.3);
      transform: translateY(-1px);
    }

    /* Responsive Design สำหรับ Top Bar */
    @media (max-width: 1200px) {
      .top-bar .container.top-bar-full-width {
        padding: 0 1.5rem;
      }

      .top-bar .left-content {
        gap: 1.5rem;
      }

      .top-bar .right-content {
        gap: 1rem;
      }
    }

    @media (max-width: 992px) {
      .top-bar {
        padding: 0.5rem 0;
        font-size: 0.8rem;
      }

      .top-bar .container.top-bar-full-width {
        padding: 0 1rem;
      }

      .top-bar .left-content {
        gap: 1rem;
      }

      .top-bar .right-content {
        gap: 0.8rem;
      }

      .top-bar .right-content a {
        padding: 0.2rem 0.6rem;
        font-size: 0.75rem;
      }
    }

    @media (max-width: 768px) {
      .top-bar .left-content span:last-child {
        display: none;
      }

      .top-bar .right-content a:not(:last-child) {
        display: none;
      }

      .top-bar .container.top-bar-full-width {
        padding: 0 0.8rem;
      }
    }

    @media (max-width: 576px) {
      .top-bar {
        padding: 0.4rem 0;
      }

      .top-bar .left-content {
        flex: 2;
      }

      .top-bar .right-content {
        flex: 1;
      }

      .top-bar .left-content span {
        font-size: 0.7rem;
      }
    }

    /* ===== MAIN HEADER REDESIGN ===== */
    .main-header-wrapper {
      background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
      padding: 0.75rem 0; /* ลดจาก 1rem เป็น 0.75rem */
      border-bottom: 1px solid rgba(30, 60, 114, 0.08);
      box-shadow: 0 3px 20px rgba(30, 60, 114, 0.05); /* ลด shadow */
      position: relative;
      z-index: 100;
      min-height: 75px; /* ลดจาก 85px เป็น 75px */
    }
    .main-header-wrapper .container {
      display: grid;
      grid-template-columns: 1fr 2fr 1fr; /* ปรับให้สมดุลมากขึ้น: ซ้าย 1 ส่วน, กลาง 2 ส่วน, ขวา 1 ส่วน */
      align-items: center;
      gap: 0.75rem; /* ลดจาก 1rem เป็น 0.75rem */
      max-width: 1200px;
      margin: 0 auto;
      padding: 0 1rem;
      height: 100%;
      min-height: 60px; /* ลดจาก 70px เป็น 60px */
    }

    /* ===== HEADER LEFT (LOGO + BRAND) ===== */
    .header-left {
      display: flex;
      align-items: center;
      gap: 0.75rem; /* ลด gap เล็กน้อย */
      flex-shrink: 0;
      white-space: nowrap;
      overflow: hidden;
      justify-self: start;
      min-width: 200px; /* ลดขนาดขั้นต่ำ */
      max-width: 300px; /* เพิ่มขนาดสูงสุด */
    }

    /* ===== HEADER CENTER (SEARCH BAR) ===== */
    .header-center {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      max-width: 600px; /* เพิ่มขนาดสูงสุด */
      margin: 0 auto;
      padding: 0 0.5rem; /* ลด padding */
    }

    /* ===== HEADER RIGHT (USER INFO + CART) ===== */
    .header-right {
      display: flex;
      align-items: center;
      gap: 0.5rem; /* ลด gap */
      flex-shrink: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      justify-self: end;
      min-width: 200px; /* ลดขนาดขั้นต่ำ */
      max-width: 300px; /* เพิ่มขนาดสูงสุด */
      justify-content: flex-end; /* จัดให้อยู่ขวาสุด */
    }

    .hamburger-menu {
      display: none; /* ซ่อนใน desktop */
      font-size: 1.3rem; /* ลดขนาดเล็กน้อย */
      background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
      border: none;
      color: white;
      padding: 0.75rem; /* ลด padding */
      border-radius: 16px; /* ลด border-radius */
      cursor: pointer;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      box-shadow: 0 4px 15px rgba(30, 60, 114, 0.2); /* ลด shadow */
      position: relative;
      overflow: hidden;
      font-weight: 600;
      flex-shrink: 0;
    }

    .hamburger-menu::before {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
      transition: left 0.6s ease;
    }

    .hamburger-menu:hover::before {
      left: 100%;
    }

    .hamburger-menu:hover {
      background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
      transform: translateY(-2px) scale(1.05); /* ลด scale */
      box-shadow: 0 6px 25px rgba(30, 60, 114, 0.3); /* ลด shadow */
    }

    .hamburger-menu:active {
      transform: translateY(-1px) scale(1.02); /* ลด scale */
      box-shadow: 0 4px 15px rgba(30, 60, 114, 0.2);
    }

    .brand-container {
      display: flex;
      align-items: center;
      gap: 0.75rem; /* ลด gap */
      text-decoration: none;
      transition: all 0.3s ease;
      min-width: max-content;
      flex-shrink: 0;
    }
    .brand-container:hover {
      transform: translateY(-1px);
    }
    .header-left #shop-logo-main {
      width: 45px; /* ลดขนาดจาก 50px เป็น 45px */
      height: 45px; /* ลดขนาดจาก 50px เป็น 45px */
      object-fit: contain;
      border-radius: 10px; /* ลดจาก 12px เป็น 10px */
      box-shadow: 0 3px 12px rgba(30, 60, 114, 0.1); /* ลด shadow */
      transition: all 0.3s ease;
      border: 2px solid rgba(30, 60, 114, 0.06); /* ลด opacity */
      flex-shrink: 0;
    }

    .brand-text {
      display: flex;
      flex-direction: column;
      min-width: 0;
    }

    #shop-name-display {
      font-size: 1.2rem; /* ลดขนาดจาก 1.3rem เป็น 1.2rem */
      font-weight: 700;
      color: #1e3c72;
      margin: 0;
      line-height: 1.2;
      text-shadow: 0 1px 2px rgba(30, 60, 114, 0.06); /* ลด shadow */
      transition: all 0.3s ease;
      white-space: nowrap;
      overflow: visible;
      min-width: max-content;
    }

    .brand-tagline {
      font-size: 0.8rem; /* ลดขนาด */
      color: #64748b;
      margin: 0;
      line-height: 1.2;
      font-weight: 500;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .search-container {
      width: 100%;
      max-width: 600px; /* เพิ่มขนาดสูงสุด */
      position: relative;
      margin: 0 auto; /* จัดกลาง */
    }
    .search-bar {
      display: flex;
      align-items: center;
      background: #ffffff;
      border: 2px solid rgba(30, 60, 114, 0.08); /* ลด opacity */
      border-radius: 22px; /* ลด border-radius */
      padding: 0.4rem; /* ลด padding */
      box-shadow: 0 3px 15px rgba(30, 60, 114, 0.06); /* ลด shadow */
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      overflow: hidden;
    }

    .search-bar:focus-within {
      border-color: #3498db;
      box-shadow: 0 4px 20px rgba(52, 152, 219, 0.15); /* ลด shadow */
      transform: translateY(-1px); /* ลด transform */
    }

    .search-bar .category-select {
      border: none;
      background: none;
      color: #64748b;
      font-size: 0.85rem; /* ลดขนาด */
      font-weight: 500;
      padding: 0.4rem 0.8rem; /* ลด padding */
      border-radius: 18px; /* ลด border-radius */
      cursor: pointer;
      transition: all 0.3s ease;
      outline: none;
      flex-shrink: 0;
    }

    .search-bar input {
      flex: 1;
      border: none;
      outline: none;
      padding: 0.6rem 0.8rem; /* ลด padding */
      font-size: 0.95rem; /* ลดขนาด */
      color: #2c3e50;
      background: transparent;
      min-width: 0;
    }

    .search-bar input::placeholder {
      color: #94a3b8;
      font-weight: 400;
    }

    .search-bar button {
      background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
      border: none;
      color: white;
      padding: 0.6rem 0.8rem; /* ลด padding */
      border-radius: 18px; /* ลด border-radius */
      cursor: pointer;
      transition: all 0.3s ease;
      font-size: 0.9rem; /* ลดขนาด */
      font-weight: 600;
      box-shadow: 0 3px 12px rgba(52, 152, 219, 0.2); /* ลด shadow */
      flex-shrink: 0;
    }

    .search-bar button:hover {
      background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
      transform: translateY(-1px) scale(1.02); /* ลด scale */
      box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3); /* ลด shadow */
    }

    .search-bar button:active {
      transform: translateY(0) scale(1);
      box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
    }

    /* ===== HEADER ACTIONS ===== */
    .header-actions {
      display: flex;
      align-items: center;
      gap: 0.5rem; /* ลด gap */
      flex-shrink: 0;
    }

    .header-actions a {
      display: flex;
      align-items: center;
      gap: 0.4rem; /* ลด gap */
      color: #2c3e50;
      text-decoration: none;
      font-size: 0.85rem; /* ลดขนาด */
      font-weight: 500;
      padding: 0.5rem 0.8rem; /* ลด padding */
      border-radius: 18px; /* ลด border-radius */
      transition: all 0.3s ease;
      white-space: nowrap;
      position: relative;
      overflow: hidden;
    }

    .header-actions a:hover {
      background: rgba(52, 152, 219, 0.08); /* ลด opacity */
      color: #3498db;
      transform: translateY(-1px);
    }

    .header-actions a i {
      font-size: 1rem; /* ลดขนาด */
      transition: all 0.3s ease;
    }

    .header-actions a:hover i {
      transform: scale(1.1);
    }

    /* ===== USER INFO ===== */
    #header-user-info {
      display: flex;
      align-items: center;
      gap: 0.5rem; /* ลด gap */
    }

    #header-user-avatar {
      width: 30px; /* ลดขนาด */
      height: 30px; /* ลดขนาด */
      border-radius: 50%;
      object-fit: cover;
      border: 2px solid rgba(52, 152, 219, 0.2);
      transition: all 0.3s ease;
    }

    #header-user-avatar:hover {
      border-color: #3498db;
      transform: scale(1.05); /* ลด scale */
    }

    #header-username {
      font-size: 0.85rem; /* ลดขนาด */
      font-weight: 600;
      color: #2c3e50;
      max-width: 80px; /* ลดขนาด */
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    /* ===== CART LINK ===== */
    .cart-link {
      position: relative;
      display: flex;
      align-items: center;
      gap: 0.4rem; /* ลด gap */
      color: #2c3e50;
      text-decoration: none;
      font-size: 0.85rem; /* ลดขนาด */
      font-weight: 500;
      padding: 0.5rem 0.8rem; /* ลด padding */
      border-radius: 18px; /* ลด border-radius */
      transition: all 0.3s ease;
      background: rgba(52, 152, 219, 0.05); /* ลด opacity */
      border: 1px solid rgba(52, 152, 219, 0.1); /* ลด opacity */
    }

    .cart-link:hover {
      background: rgba(52, 152, 219, 0.1); /* ลด opacity */
      color: #3498db;
      transform: translateY(-1px);
      box-shadow: 0 3px 12px rgba(52, 152, 219, 0.15); /* ลด shadow */
    }

    .cart-badge {
      background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
      color: white;
      border-radius: 50%;
      padding: 0.2rem 0.4rem; /* ลด padding */
      font-size: 0.7rem; /* ลดขนาด */
      font-weight: 600;
      min-width: 18px; /* ลดขนาด */
      height: 18px; /* ลดขนาด */
      display: flex;
      align-items: center;
      justify-content: center;
      position: absolute;
      top: -5px; /* ปรับตำแหน่ง */
      right: -5px; /* ปรับตำแหน่ง */
      box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3); /* ลด shadow */
      animation: pulse 2s infinite;
    }

    @keyframes pulse {
      0% { transform: scale(1); }
      50% { transform: scale(1.05); } /* ลด scale */
      100% { transform: scale(1); }
    }

    /* ===== RESPONSIVE DESIGN ===== */
    @media (max-width: 1200px) {
      .main-header-wrapper .container {
        grid-template-columns: 1fr 1.8fr 1fr; /* ปรับสัดส่วน */
        gap: 0.8rem;
        padding: 0 0.8rem;
      }
      .header-left {
        min-width: 180px;
        max-width: 280px;
      }
      .header-right {
        min-width: 180px;
        max-width: 280px;
      }
      .search-container {
        max-width: 500px;
      }
      .header-actions a {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
      }
    }

    @media (max-width: 992px) {
      .main-header-wrapper .container {
        grid-template-columns: 1fr 1.5fr 1fr; /* ปรับสัดส่วน */
        gap: 0.6rem;
        padding: 0 0.6rem;
      }
      .header-left {
        min-width: 160px;
        max-width: 240px;
      }
      .header-right {
        min-width: 160px;
        max-width: 240px;
      }
      .search-container {
        max-width: 400px;
      }
      .header-actions a {
        font-size: 0.75rem;
        padding: 0.35rem 0.5rem;
      }
      #shop-name-display {
        font-size: 1.1rem;
      }
      .brand-tagline {
        font-size: 0.75rem;
      }
    }

    /* ===== MAIN NAVIGATION ===== */
    .main-nav {
      background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
      padding: 1rem 0;
      position: relative;
      z-index: 997;
      box-shadow: 0 6px 25px rgba(44, 62, 80, 0.2);
      margin-top: 0;
      width: 100vw;
      margin-left: calc(-50vw + 50%);
      left: 0;
      backdrop-filter: blur(15px);
      -webkit-backdrop-filter: blur(15px);
    }

    .main-nav::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    }

    .main-nav .container.main-nav-full-width {
  display: flex;
  justify-content: center; /* กลับมาใช้ center เพื่อให้เมนูอยู่ตรงกลาง */
  align-items: center;
  gap: 2rem; /* กลับมาใช้ระยะห่างเดิม */
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  box-sizing: border-box;
}

    .main-nav .container.main-nav-full-width::-webkit-scrollbar {
      display: none;
    }

    .main-nav a {
      color: rgba(255,255,255,0.95);
      text-decoration: none;
      font-weight: 500;
      font-size: 1rem;
      padding: 0.8rem 1.8rem;
      border-radius: 25px;
      transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
      position: relative;
      backdrop-filter: blur(10px);
      border: 1px solid rgba(255,255,255,0.15);
      white-space: nowrap;
      flex-shrink: 0;
      background: rgba(255,255,255,0.05);
      margin: 0 0.25rem; /* เพิ่มระยะห่างเล็กน้อยระหว่างปุ่ม */
    }

    .main-nav a::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
      border-radius: 20px;
      opacity: 0;
      transition: opacity 0.3s ease;
    }

    .main-nav a:hover {
      color: #ffffff;
      background: linear-gradient(135deg, #3498db 0%, #2980b9 100%); /* ใช้สี gradient เหมือนปุ่มอื่นๆ */
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
      border: 1px solid rgba(255,255,255,0.3);
    }

    .main-nav a:hover::before {
      opacity: 1;
    }

    .main-nav a:active {
      transform: translateY(0);
      background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    }

    .main-nav a.active {
      background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
      color: #ffffff;
      border: 1px solid rgba(255,255,255,0.3);
      box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
    }

    /* ===== RESPONSIVE DESIGN ===== */
    @media (max-width: 1200px) {
      .main-header-wrapper .container {
        grid-template-columns: 240px 1fr 280px; /* ปรับขนาดให้เหมาะสม */
        gap: 1rem;
      }
      #shop-name-display {
        font-size: 1.1rem;
      }
      .search-container {
        max-width: 450px;
      }
      .header-actions a {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
      }
    }

    @media (max-width: 992px) {
      .main-header-wrapper {
        padding: 0.75rem 0;
        min-height: 70px;
      }
      .main-header-wrapper .container {
        grid-template-columns: 200px 1fr 240px; /* ปรับขนาดให้เหมาะสม */
        gap: 0.75rem;
      }
      .header-left {
        min-width: 180px;
      }
      .header-center {
        max-width: 400px;
        padding: 0 0.5rem;
      }
      .header-right {
        min-width: 220px;
      }
      .hamburger-menu {
        display: none !important; /* Temporarily hidden */
        padding: 0.75rem;
        font-size: 1.25rem;
        border-radius: 15px;
        margin-right: 0.5rem;
      }
      .brand-tagline {
        display: none;
      }
      .main-nav {
        display: block;
        padding: 0.8rem 0;
      }
      .main-nav .container.main-nav-full-width {
        padding: 0 1rem;
        gap: 1.2rem;
        justify-content: flex-start;
      }
      .main-nav a {
        font-size: 0.9rem;
        padding: 0.6rem 1.2rem;
        border-radius: 20px;
        min-width: max-content;
      }
      .header-actions {
        gap: 0.5rem;
      }
      .header-actions a {
        font-size: 0.8rem;
        padding: 0.35rem 0.5rem;
      }
    }

    @media (max-width: 768px) {
      .main-header-wrapper {
        padding: 0.75rem 0; /* เพิ่ม padding เล็กน้อย */
        min-height: 70px; /* เพิ่มความสูงเล็กน้อย */
      }
      .main-header-wrapper .container {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        padding: 0 0.75rem;
      }
      .header-top-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
      }
      .header-left {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        min-width: auto;
        flex: 1;
      }
      .hamburger-menu {
        display: block;
        padding: 0.5rem;
        font-size: 1.1rem;
        border-radius: 12px;
        margin-right: 0.5rem;
      }
      .brand-container {
        gap: 0.5rem;
      }
      .header-left #shop-logo-main {
        width: 40px;
        height: 40px;
      }
      #shop-name-display {
        font-size: 1.1rem;
      }
      .brand-tagline {
        font-size: 0.75rem;
      }
      .header-center {
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: 0;
      }
      .search-container {
        width: 100%;
        max-width: 100%;
        margin: 0;
      }
      .search-bar {
        width: 100%;
        max-width: 100%;
        padding: 0.4rem;
      }
      .search-bar .category-select {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
      }
      .search-bar input {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
      }
      .search-bar button {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
      }
      .header-right {
        position: static;
        min-width: auto;
        max-width: none;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding: 0;
        margin-left: auto;
        flex-shrink: 0;
      }
      .header-actions {
        gap: 0.4rem;
      }
      .header-actions a {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
      }
      .header-actions a i {
        font-size: 0.9rem;
        margin-right: 0.3rem;
      }
      #header-user-avatar {
        width: 28px;
        height: 28px;
      }
      #header-username {
        font-size: 0.8rem;
        max-width: 70px;
      }
      .cart-badge {
        font-size: 0.65rem;
        min-width: 16px;
        height: 16px;
        top: -4px;
        right: -4px;
      }

      .main-nav a {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
      }
    }

    @media (max-width: 576px) {
      .main-header-wrapper {
        padding: 0.5rem 0;
        min-height: 65px;
      }
      .main-header-wrapper .container {
        gap: 0.5rem;
        padding: 0 0.5rem;
      }
      .header-top-row {
        gap: 0.5rem;
      }
      .header-left {
        gap: 0.4rem;
      }
      .header-left #shop-logo-main {
        width: 35px;
        height: 35px;
      }
      #shop-name-display {
        font-size: 1rem;
      }
      .brand-tagline {
        font-size: 0.7rem;
      }
      .search-bar {
        padding: 0.35rem;
      }
      .search-bar .category-select {
        font-size: 0.75rem;
        padding: 0.35rem 0.5rem;
      }
      .search-bar input {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
      }
      .search-bar button {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
      }
      .header-right {
        gap: 0.3rem;
      }
      .header-actions {
        gap: 0.3rem;
      }
      .header-actions a {
        padding: 0.35rem 0.5rem;
        font-size: 0.75rem;
      }
      .header-actions a i {
        font-size: 0.85rem;
        margin-right: 0.2rem;
      }
      .header-actions a span {
        display: none; /* ซ่อนข้อความในหน้าจอเล็ก */
      }
      #header-user-avatar {
        width: 26px;
        height: 26px;
      }
      #header-username {
        display: none; /* ซ่อนชื่อผู้ใช้ในหน้าจอเล็ก */
      }
      .cart-link span:not(.cart-badge) {
        display: none;
      }
      .cart-badge {
        font-size: 0.6rem;
        min-width: 14px;
        height: 14px;
        top: -3px;
        right: -3px;
      }
    }

    @media (max-width: 768px) {
      .top-bar-container {
        padding: 0 0.75rem;
      }
      .top-bar .left-content {
        flex: 1;
        gap: 1rem;
      }
      .top-bar .right-content {
        flex: 1.5;
        gap: 1rem;
        padding-left: 1rem;
      }
      .top-bar a, .top-bar .dropdown > button {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
      }
    }

    @media (max-width: 480px) {
      .top-bar-container {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
        padding: 0.75rem 0.5rem;
      }
      .top-bar .left-content {
        flex: none;
        justify-content: center;
        width: 100%;
        gap: 0.8rem;
      }
      .top-bar .right-content {
        flex: none;
        justify-content: center;
        width: 100%;
        gap: 0.8rem;
        padding-left: 0;
        white-space: nowrap;
      }
      .top-bar a, .top-bar .dropdown > button {
        font-size: 0.75rem;
        padding: 0.35rem 0.6rem;
        white-space: nowrap;
      }
    }
      .header-left #shop-logo-main {
        width: 32px;
        height: 32px;
      }
      #shop-name-display {
        font-size: 0.9rem;
      }
      .search-bar {
        padding: 0.4rem;
      }
      .search-bar .category-select {
        font-size: 0.75rem;
        padding: 0.35rem;
      }
      .search-bar input {
        font-size: 0.8rem;
        padding: 0.35rem 0.5rem;
      }
      .search-bar button {
        padding: 0.35rem 0.5rem;
        font-size: 0.85rem;
      }
      .header-right {
        top: 0.4rem;
        right: 0.4rem;
        padding: 0.3rem;
      }
      .header-actions {
        gap: 0.3rem;
      }
      .header-actions a {
        padding: 0.25rem 0.4rem;
        font-size: 0.7rem;
        min-width: 32px;
      }
      .header-actions a i {
        font-size: 0.85rem;
        margin-right: 0;
      }
      .header-actions a span {
        display: none;
      }
      .cart-badge {
        font-size: 0.65rem;
        min-width: 14px;
        height: 14px;
        line-height: 14px;
      }


    /* Mega Menu removed - continuing with other styles */
  /* ========== NEW MEGA MENU (FULL-WIDTH DROPDOWN STYLE) ========== */
  .mega-menu-content {
    position: absolute;
    top: 100%; /* Sit directly under the navigation bar */
    left: 0;
    width: 100%;
    max-width: none; /* Full width */
    height: auto;
    background: #ffffff;
    border: 1px solid #d9e1ee;
    border-top: none;
    box-shadow: 0 8px 24px -4px rgba(0,0,0,0.15);
    display: none; /* Hidden until active */
    padding: 0; /* We'll handle padding inside body */
    z-index: 1200;
    animation: megaFadeIn .18s ease;
  }

  @keyframes megaFadeIn { from { opacity:0; transform:translateY(4px);} to {opacity:1; transform:translateY(0);} }

  .mega-menu-overlay.is-open .mega-menu-content { display: block; }

  /* Container inside for horizontal padding & max width constraint (optional center) */
  .mega-menu-inner {
    max-width: 1400px; /* Similar to reference site */
    margin: 0 auto;
    padding: 20px 32px 28px 32px;
    display: flex;
    gap: 32px;
    align-items: flex-start;
  }

  /* Left main category list column */
  .main-categories-panel {
    width: 260px; /* Fixed column like reference */
    flex: 0 0 260px;
    background: #f5f8fd;
    border: 1px solid #e1e7ef;
    border-radius: 6px;
    padding: 6px 0;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4);
    overflow-y: auto;
    max-height: 520px;
  }

  .main-categories-panel::-webkit-scrollbar { width: 6px; }
  .main-categories-panel::-webkit-scrollbar-thumb { background:#c1c9d4; border-radius:4px; }

  /* Right content area (subcategories, brands, etc.) */
  .sub-categories-panel {
    flex: 1 1 auto;
    width: auto;
    padding: 4px 10px 0 10px;
    background: #fff;
    overflow-y: auto;
    max-height: 520px;
  }

  .mega-menu-body { /* Re-layout body for new style */
    display: flex;
    flex-direction: row;
    gap: 32px;
    overflow: hidden;
    padding: 0; /* Padding now on .mega-menu-inner */
  }

    .mega-menu-header {
        display: flex;
        align-items: center;
        padding: 10px 15px;
        border-bottom: 1px solid #eee;
        background-color: #fff; /* Match BNN example header */
    }

    .mega-menu-header .close-mega-menu {
        background: none;
        border: none;
        font-size: 28px; /* Slightly larger X */
        font-weight: 300;
        color: #666;
        cursor: pointer;
        margin-right: 15px;
        padding: 0px 5px;
        line-height: 1;
    }

    .mega-menu-header .logo-link img#mega-menu-logo {
        max-height: 30px; /* Adjust to match BNN logo size */
        width: auto;
        vertical-align: middle;
    }

    .mega-menu-header #mega-menu-shop-name { /* If you show shop name next to logo */
        font-weight: 600;
        margin-left: 10px;
        font-size: 18px;
        color: #000;
    }

  /* (Old layout styles removed – using new full-width dropdown styles defined above) */

  .sub-categories-panel {
    width: 62%; /* Complements 38% = 100% within flex container */
    padding: 15px 20px; /* Padding for sub-category content area */
    overflow-y: auto;
    background-color: #fff;
  }

    #main-categories-list,
    #sub-categories-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    #main-categories-list li a {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px; /* BNN-like padding */
        text-decoration: none;
        color: #333;
        border-bottom: 1px solid #eee;
        font-size: 14px; /* BNN-like font size */
        transition: background-color 0.2s ease, color 0.2s ease;
    }

  /* #main-categories-list li:first-child a {} removed: no special styling needed */

    #main-categories-list li a:hover,
    #main-categories-list li a.active {
        background-color: #fff; /* White background when active/hover */
        color: #000; /* Black text when active/hover */
        font-weight: 500; /* Slightly bolder */
    }
    /* Style for the yellow highlight on active like BNN */
    #main-categories-list li a.active {
        border-left: 3px solid #ffd400; /* Yellow left border for active */
        padding-left: 17px; /* Adjust to keep text aligned */
        color: #000;
        background-color: #fff;
    }


    #main-categories-list li a i.fa-chevron-right {
        font-size: 12px;
        color: #aaa;
    }
    #main-categories-list li a:hover i.fa-chevron-right,
    #main-categories-list li a.active i.fa-chevron-right {
        color: #333; /* Darker chevron on hover/active */
    }


    #sub-categories-title {
        font-size: 14px; /* BNN-like size */
        font-weight: 600;
        color: #000; /* Black title */
        margin-bottom: 10px;
        padding-bottom: 10px;
        /* border-bottom: 1px solid #eee; Remove if not in BNN */
    }

    /* For BNN, the subcategory title is often the "View All X" link itself */
    #sub-categories-list li a.view-all-sub {
        display: block;
        padding: 10px 0px;
        text-decoration: none;
        color: #000; /* Black for "View All" */
        font-size: 14px;
        font-weight: 600; /* Bold "View All" */
        margin-bottom: 10px; /* Space after "View All" */
    }
    #sub-categories-list li a.view-all-sub:hover {
        color: #0056b3;
    }


    #sub-categories-list li a:not(.view-all-sub) {
        display: block;
        padding: 8px 0px; /* BNN-like padding */
        text-decoration: none;
        color: #555;
        font-size: 14px; /* BNN-like font size */
        /* border-bottom: 1px solid #f5f5f5; */ /* BNN doesn't seem to have borders here */
        transition: color 0.2s ease;
    }

    #sub-categories-list li a:not(.view-all-sub):hover {
        color: #0056b3; /* Theme color on hover */
    }

    /* Remove last border if any were applied */
    #main-categories-list li:last-child a {
        border-bottom: none;
    }
  /* #sub-categories-list li:last-child a:not(.view-all-sub) {} removed: no override needed */

    /* Responsive adjustments for Mega Menu */
  @media (max-width: 768px) {
    .mega-menu-content { top: 100%; border-left: none; border-right: none; }
    .mega-menu-inner { flex-direction: column; padding: 12px 18px 22px 18px; gap: 16px; }
    .main-categories-panel { width: 100%; flex: 1 1 auto; max-height: 240px; }
    .sub-categories-panel { width: 100%; max-height: 360px; }
    .mega-menu-body { flex-direction: column; gap: 16px; }
  }

    /* Custom styles for the new product grid (V1) */
    .product-grid-custom {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Default, can be overridden by section settings */
      gap: 1.5rem; /* Increased gap */
      padding: 1rem 0;
    }
    .product-card-custom {
      background-color: #fff;
      border: 1px solid #f0f0f0; /* V1 border */
      border-radius: 12px;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      transition: box-shadow 0.3s ease, transform 0.2s ease; /* Combined transition */
      text-decoration: none;
      color: inherit;
      height: 100%; /* For d-flex align-items-stretch on parent col, from V2 def */
    }
    .product-card-custom:hover {
      box-shadow: 0 8px 16px rgba(0,0,0,0.1); /* V2 hover shadow */
      transform: translateY(-3px); /* V2 hover transform */
    }
    .product-image-wrapper {
      position: relative;
      background-color: #f7f7f7;
      padding: 1rem;
    }
    .product-image-wrapper img {
      width: 100%;
      height: auto;
      aspect-ratio: 1 / 1;
      object-fit: contain;
    }
    .product-brand-tag {
      position: absolute;
      top: 1rem;
      left: 1rem;
      font-size: 0.75rem;
      color: #999;
      font-weight: 500;
      text-transform: uppercase;
    }
    .product-promo-tags {
      position: absolute;
      top: 1rem;
      right: 1rem;
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }
    .promo-tag {
      width: 40px;
      height: 40px;
      border-radius: 8px;
    }
    .promo-tag.cashback {
      background-color: #ffc700;
      display: flex;
      justify-content: center;
      align-items: center;
      font-weight: 700;
      color: #000;
      font-size: 1.2rem;
    }
    .promo-tag.freebie {
      background-color: #e52525;
      display: flex;
      justify-content: center;
      align-items: center;
      font-weight: 700;
      color: #fff;
      font-size: 0.8rem;
    }
    .product-overlay-banner {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      background-color: rgba(239, 131, 40, 0.9);
      padding: 0.5rem;
      text-align: center;
    }
    .product-overlay-banner span {
      font-weight: 600;
      color: white;
      font-size: 0.85rem;
    }
    .product-info-custom {
      padding: 1rem;
      display: flex;
      flex-direction: column;
      flex-grow: 1;
    }
    .product-name-custom {
      font-size: 0.9rem;
      font-weight: 600;
      line-height: 1.4;
      margin-bottom: 0.5rem;
      color: #333;
      text-align: center;
      padding: 0 12px;
    }
    .product-spec-custom {
      font-size: 0.75rem;
      color: #888;
      line-height: 1.5;
      margin-bottom: 1rem;
      flex-grow: 1;
      padding: 0 12px;
    }
    .product-price-custom {
      font-size: 1.25rem;
      font-weight: 700;
      color: #d70018;
    }
    .product-old-price-custom {
      font-size: 0.85rem;
      color: #aaa;
      text-decoration: line-through;
      margin-left: 0.5rem;
    }

    /* NEW DETAILED PRODUCT CARD STYLES (applies to .product-card-custom if a more detailed layout is used) */
    .product-grid-item-detailed {
        display: flex; /* Ensure items in a row are aligned if they have different content heights before card itself */
        margin-bottom: 1.5rem; /* Ensure spacing between rows */
    }

    /* .product-card-custom is already defined above, this section details its children for detailed view */

    .product-link-area {
        display: flex;
        flex-direction: column;
        flex-grow: 1; /* Allows info section to grow and push purchase controls down */
    }

    .product-image-section {
        overflow: hidden;
        background-color: #f7f7f7; /* Light background for images */
    }
    .product-main-image {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1; /* Maintain square aspect ratio */
        object-fit: contain; /* Show entire image, might need 'cover' depending on source images */
        padding: 10px; /* Small padding around the image within its container */
        transition: transform 0.3s ease;
    }
    .product-card-custom:hover .product-main-image {
        transform: scale(1.05);
    }

    .badge-overlay {
        position: absolute;
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
        font-weight: bold;
        color: white;
        border-radius: 3px;
        line-height: 1;
    }
    .top-left {
        top: 10px;
        left: 10px;
    }
    .bottom-left {
        bottom: 10px;
        left: 10px;
    }
    .bottom-right {
        bottom: 10px;
        right: 10px;
    }
    .best-price-badge {
        background-color: #dc3545; /* Red for best price */
    }
    .new-product-badge {
        background-color: #0d6efd; /* Blue for new product */
    }
    .thirty-sixty-badge img,
    .ict-badge img {
        width: 24px; /* Adjust size as needed */
        height: 24px;
        background-color: rgba(0,0,0,0.4);
        padding: 4px;
        border-radius: 50%;
    }

    .product-info-section {
        display: flex;
        flex-direction: column;
        flex-grow: 1; /* Take remaining space */
    }

    .product-name-title {
        font-size: 0.9rem; /* Slightly smaller than h5 default */
        line-height: 1.4;
        min-height: calc(2 * 1.4em); /* Reserve space for 2 lines */
        text-align: center;
        padding: 0 12px;
    }

    .text-truncate-2-lines {
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
  -webkit-line-clamp: 2; /* number of lines to show */
  line-clamp: 2;
        -webkit-box-orient: vertical;
    }

  .product-freebie-line,
  .product-specs-line {
    font-size: 0.7rem; /* smaller than 12px title */
    line-height: 1.4;
  }
    .product-freebie-line .see-more-link {
        cursor: pointer;
        font-weight: 500;
    }
    .product-specs-line {
        min-height: auto;
        overflow: visible !important;
    }

    .product-original-price-info {
        font-size: 0.8rem;
    }

  /* Removed empty rule: .product-purchase-controls-section */

    .btn-add-to-cart-main {
        background-color: #007bff; /* Primary blue */
        border-color: #007bff;
        color: white;
        line-height: 1.2;
        transition: background-color 0.2s ease, border-color 0.2s ease;
    }
    .btn-add-to-cart-main:hover {
        background-color: #0056b3;
        border-color: #0056b3;
    }
    .btn-add-to-cart-main .current-price-tag {
        display: block;
    }
    .btn-add-to-cart-main .add-to-cart-text {
        display: block;
        font-size: 0.8rem;
    }
    .btn-add-to-cart-main.btn-success {
        background-color: #28a745 !important; /* Green for success */
        border-color: #28a745 !important;
    }

    .product-savings-text {
        font-size: 0.8rem;
        min-height: 1.2em; /* Ensure consistent height even if empty */
    }

    .product-actions-bar {
        border-top: 1px solid #f0f0f0 !important;
    }
    .product-actions-bar .action-link {
        text-decoration: none;
        transition: color 0.2s ease;
    }
    .product-actions-bar .action-link:hover {
        color: #007bff !important;
    }
    .product-actions-bar .action-link i {
        font-size: 1rem; /* Adjust icon size if needed */
    }
    .product-view-count {
        font-size: 0.8rem;
    }

    /* NEW DETAILED PRODUCT CARD STYLES V2 (Monitor Style) */
    .product-card-custom-v2 {
        border: 1px solid #e0e0e0;
        transition: box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
    }
    .product-card-custom-v2:hover {
        box-shadow: 0 6px 12px rgba(0,0,0,0.1);
        transform: translateY(-2px);
    }

  /* Removed empty rule: .product-link-area-v2 */

    .product-image-section-v2 {
        background-color: #ffffff; /* Typically white or transparent */
        overflow: hidden;
    }
    .product-main-image-v2 {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1; /* Or adjust as needed, e.g., 4/3 */
        object-fit: contain;
        padding: 1rem; /* Padding around the image inside its container */
        transition: transform 0.25s ease;
    }
    .product-card-custom-v2:hover .product-main-image-v2 {
        transform: scale(1.03);
    }

    .badge-overlay-v2 {
        position: absolute;
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem; /* Slightly larger badge text */
        font-weight: 500;
        line-height: 1;
        border-radius: 0; /* Square badges as in example */
        text-transform: uppercase;
    }
    .top-left-v2 {
        top: 0;
        left: 0;
        /* background-color: rgba(255,255,255,0.8); /* Optional semi-transparent background for brand */
        /* color: #333; */
        /* padding: 0.4rem 0.7rem; */
        /* border-bottom-right-radius: 5px; */
    }
    .brand-badge-v2 {
        background-color: rgba(230, 230, 230, 0.85); /* Light grey, adjust as needed */
        color: #333;
        font-weight: bold;
        font-size: 0.7rem;
        padding: 4px 8px;
    }

    .top-right-v2 {
        top: 0;
        right: 0;
        /* background-color: #D32F2F; /* Default red for promo */
        /* color: white; */
        /* border-bottom-left-radius: 5px; */
    }
    .promo-badge-v2 {
        /* Specific background/color will be inline or from JS based on tag data */
        font-weight: bold;
        font-size: 0.7rem;
        padding: 4px 8px;
        color: white; /* Default, can be overridden */
        background-color: #E53935; /* Default, can be overridden */
    }

    .product-info-section-v2 {
        /* Padding is already applied via p-3 */
        flex-grow: 1; /* Allows this section to push button and actions bar down */
        display: flex;
        flex-direction: column;
    }

    .product-name-v2 {
        font-size: 0.95rem; /* Matches monitor image closer */
        line-height: 1.45;
        text-align: center;
        padding: 0 12px;
        /* min-height: calc(3 * 1.45em); /* Reserve space for 3 lines */
        /* max-height: calc(3 * 1.45em); */
    }

    .text-truncate-3-lines {
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
  -webkit-line-clamp: 3; /* number of lines to show */
  line-clamp: 3;
        -webkit-box-orient: vertical;
        min-height: calc(3 * 1.45em); /* Ensure space for 3 lines to prevent jump */
    }
    .text-truncate-4-lines {
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
  -webkit-line-clamp: 4; /* number of lines to show */
  line-clamp: 4;
        -webkit-box-orient: vertical;
        min-height: calc(4 * 1.35em); /* Ensure space for 4 lines product-specs-v2 uses 1.35 line height*/
    }

    .product-specs-v2 {
      font-size: 0.78rem; /* slightly smaller for compactness */
        line-height: 1.35;
        color: #555;
        /* min-height: calc(4 * 1.35em); /* Reserve space for 4 lines */
        /* max-height: calc(4 * 1.35em); */
        flex-grow: 1; /* Allow specs to take available space before price line */
    }

  /* Removed empty rule: .product-price-details-v2 */

    .current-list-price-v2 {
        color: #212529; /* Darker than primary for emphasis, as in example */
        font-weight: 600 !important; /* As in example */
    }

  /* Removed empty rule: .old-price-v2 */
  /* Removed empty rule: .warranty-v2 */

  /* Removed empty rule: .product-purchase-section-v2 */

    .btn-add-to-cart-main-v2 {
        background-color: #00A9E8; /* เปลี่ยนสีพื้นหลังปุ่ม */
        border-color: #00A9E8; /* เปลี่ยนสีขอบปุ่ม */
        color: white;
        font-weight: bold;
        line-height: 1.2;
        border-radius: 25px !important; /* เพิ่มความโค้งมนของปุ่ม */
        padding: 0.75rem 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }
    .btn-add-to-cart-main-v2:hover {
        background-color: #008fcf; /* สีปุ่มเมื่อ hover (ปรับให้อ่อนลงเล็กน้อย) */
        border-color: #008fcf; /* สีขอบปุ่มเมื่อ hover */
    }

    /* This wrapper is the direct child of the button and will stack its content */
    .btn-add-to-cart-main-v2 .cart-button-content-wrapper {
        display: flex;
        flex-direction: column; /* เรียงราคาและ "ราคาออนไลน์" ในแนวตั้ง */
        align-items: center;
        justify-content: center;
        width: 100%; /* Take full width of the button for centering */
    }

    /* This line contains the icon and the main price */
    .btn-add-to-cart-main-v2 .price-line-in-button {
        display: flex;
        align-items: center;
        justify-content: center;
        /* margin-bottom: 2px; /* อาจจะไม่ต้องการถ้าข้อความราคาออนไลน์อยู่บรรทัดใหม่ */
    }
    .btn-add-to-cart-main-v2 .fa-shopping-cart {
        font-size: 1rem; /* Adjusted icon size */
        margin-right: 0.5rem; /* เพิ่มระยะห่างไอคอนกับราคา */
    }
    .price-in-button-v2 {
       font-size: 1.25rem; /* ปรับขนาดราคาให้ใหญ่ขึ้นตามภาพ */
       font-weight: bold;
       line-height: 1.1;
    }

    .online-price-text-in-button {
        font-size: 0.8rem; /* ปรับขนาด "ราคาเฉพาะออนไลน์" */
        font-weight: normal;
        color: #f0f0f0; /* ปรับสีให้อ่อนลงเล็กน้อย */
        line-height: 1;
        margin-top: 4px; /* เพิ่มระยะห่างด้านบน */
        /* margin-bottom: 2px; */
    }

    .savings-in-button-v2 {
        display: none; /* ซ่อน .savings-in-button-v2 ถ้าไม่ต้องการแสดงส่วนลดในปุ่มนี้ */
        /* font-size: 0.75rem; */
        /* color: #f8f9fa; */
        /* font-weight: 500; */
        /* line-height: 1; */
        /* min-height: 1em; /* Ensure space even if empty to prevent jump */
    }

     /* Success state for addToCart button */
    .btn-add-to-cart-main-v2.btn-success {
        background-color: #28a745 !important;
        border-color: #28a745 !important;
    }
    .btn-add-to-cart-main-v2.btn-success .savings-in-button-v2 {
        color: #f8f9fa; /* Ensure it's still readable on green */
    }

  /* Removed empty rule: .product-actions-bar-v2 */
    .product-actions-bar-v2 .action-link-v2 {
        text-decoration: none;
        transition: color 0.2s ease;
        font-size: 0.8rem; /* Match example */
    }
    .product-actions-bar-v2 .action-link-v2:hover {
        color: #0072CE !important; /* Match button blue */
    }
    .product-actions-bar-v2 .action-link-v2 i {
        font-size: 0.9rem; /* Match example */
        margin-right: 0.3rem !important; /* Ensure spacing before text */
    }
    .product-view-count-v2 {
        font-size: 0.8rem; /* Match example */
    }
    .product-view-count-v2 i {
        font-size: 0.9rem; /* Match example */
         margin-right: 0.3rem !important;
    }

    /* Styles for additional warranty badge */
    .warranty-badge-image-v2 {
        height: 20px; /* Adjust as needed */
        width: auto; /* Maintain aspect ratio */
        vertical-align: middle; /* Align with text */
    }
    .warranty-badge-text-v2 {
        display: inline-block;
        padding: 0.2em 0.5em;
        font-size: 0.7em; /* Relative to parent .warranty-v2 */
        font-weight: bold;
        color: white;
        background-color: #0072CE; /* Default blue, can be customized */
        border-radius: 10px; /* Rounded badge */
        vertical-align: middle;
        line-height: 1.2;
    }

    /* Search Suggestions Dropdown */
    #search-suggestions-dropdown {
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        border-radius: 0 0 4px 4px; /* Optional: Rounded bottom corners */
    }

    #search-suggestions-list li a {
        display: block;
        padding: 0.5rem 1rem;
        text-decoration: none;
        color: #333;
        font-size: 0.9rem;
    }

    #search-suggestions-list li a:hover {
        background-color: #f0f0f0;
    }

/* START: New Category Bar Styles (V2) */
.category-bar-wrapper-v2 {
  background: linear-gradient(135deg, #e8f4f8 0%, #f8f9fa 100%); /* Subtle gradient background */
  padding: 0.75rem 0;      /* Vertical padding for the wrapper */
  border-bottom: 1px solid #dee2e6;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05); /* Subtle shadow */
  /* overflow-x: auto; REMOVED - will be handled by child */
  min-height: 80px; /* เพิ่มความสูงขั้นต่ำ */
}

/* Normal category bar section styling */
#category-bar-section {
  border: none;
  background: #ffffff;
}

.category-bar-nav-v2 {
  display: flex !important;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: center;
  gap: 0.75rem;
  -webkit-overflow-scrolling: touch;
  min-height: 60px;
  background: transparent;
  border: none;
  overflow-x: auto;
  position: relative;
}

/* Remove default scrollbar and use a subtle one */
.category-bar-nav-v2::-webkit-scrollbar {
  height: 4px;
  background-color: #f0f0f0;
}
.category-bar-nav-v2::-webkit-scrollbar-thumb {
  background-color: #cccccc;
  border-radius: 2px;
}
.category-bar-nav-v2::-webkit-scrollbar-thumb:hover {
  background-color: #aaaaaa;
}


a.category-button-v2 {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 12px 20px !important;
  border-radius: 8px !important;
  background-color: #2c3e50 !important;
  color: white !important;
  text-decoration: none !important;
  border: none !important;
  box-shadow: none !important;
  transition: all 0.3s ease !important;
  cursor: pointer !important;
  flex-shrink: 0 !important; /* Prevent buttons from shrinking */
  min-width: 100px !important;               /* Minimum width for text */
  font-weight: 500 !important;
  font-size: 14px !important;
  white-space: nowrap !important;            /* Prevent text wrapping */
  margin: 5px !important;                    /* Space between buttons */
}

/* Hover effect for category buttons */
a.category-button-v2:hover {
  background-color: #34495e !important;
  color: white !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(52, 73, 94, 0.3) !important;
}

/* Icon styling in category buttons */
a.category-button-v2 .category-icon-v2-fallback {
  margin-right: 8px !important;
  font-size: 16px !important;
}

/* Text styling in category buttons */
a.category-button-v2 .category-name-v2 {
  font-weight: 500 !important;
  font-size: 14px !important;
}

/* Live Search Suggestions Styling */
.live-search-suggestions {
  position: fixed !important;
  background: white !important;
  border: 1px solid #ddd !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
  z-index: 999999 !important;
  max-height: 300px !important;
  overflow-y: auto !important;
  display: none !important;
}

.live-search-suggestions.show {
  display: block !important;
}

.live-search-item {
  display: flex !important;
  align-items: center !important;
  padding: 12px 15px !important;
  border-bottom: 1px solid #f0f0f0 !important;
  cursor: pointer !important;
  transition: background-color 0.2s ease !important;
}

.live-search-item:last-child {
  border-bottom: none !important;
}

.live-search-item:hover {
  background-color: #f8f9fa !important;
}

.live-search-item img {
  width: 40px !important;
  height: 40px !important;
  object-fit: cover !important;
  border-radius: 4px !important;
  margin-right: 12px !important;
  flex-shrink: 0 !important;
}

.live-search-item-info {
  flex: 1 !important;
}

.live-search-item-name {
  font-weight: 500 !important;
  font-size: 14px !important;
  color: #333 !important;
  margin-bottom: 4px !important;
  line-height: 1.3 !important;
}

.live-search-item-price {
  font-size: 13px !important;
  color: #007bff !important;
  font-weight: 600 !important;
}

a.category-button-v2 img.category-icon-v2,
a.category-button-v2 i.category-icon-v2 {
  width: 30px;
  height: 30px;
  font-size: 28px;
  object-fit: contain;
  color: inherit;
  pointer-events: none; /* Make sure click goes to the button */
  border-radius: 50%; /* ADDED: Ensure the icon image itself is circular */
}

a.category-button-v2:hover {
  transform: scale(1.15); /* Springy scale up */
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

a.category-button-v2.active {
  /* Background color is set by JS for uniqueness */
  /* Active state indicated by a more prominent outline/border */
  outline-color: #0056b3; /* Or use a CSS variable if preferred */
  box-shadow: 0 3px 7px rgba(0, 86, 179, 0.25); /* Shadow matching the outline color */
  transform: scale(1.05); /* Slight scale to indicate active state subtly */
}

/* Ensure the main page container respects these elements */

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
}

/* Full-Width Hero Section Styles - Edge to Edge Display */
.full-width-section {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.hero-section {
    margin: 0;
    padding: 0;
    background: transparent;
}

/* Simple Hero Slider */
#main-hero-slider {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.main-hero-slider-container {
    width: 100%;
    max-width: 100%;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
}

.main-hero-slider-container {
    width: 100% !important;
    max-width: 100% !important;
    height: 600px !important; /* เพิ่มความสูงให้มากขึ้น */
    max-height: none !important; /* ไม่จำกัดความสูงสูงสุด */
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.main-hero-slider-container .swiper-slide {
    width: 100% !important;
    height: 600px; /* เพิ่มความสูงให้มากขึ้นอีก */
    overflow: hidden;
    position: relative;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.main-hero-slider-container .swiper-slide a {
    width: 100%;
    height: 100%;
    display: block;
    text-decoration: none;
    position: relative;
    padding: 0 !important;
    margin: 0 !important;
}

.main-hero-slider-container .swiper-slide img {
    width: 100% !important; /* เต็มความกว้างหน้าจอ */
    height: 100% !important;
    max-height: none !important; /* ไม่จำกัดความสูงสูงสุด */
    object-fit: cover !important; /* รักษาสัดส่วน ครอบพื้นที่ */
    object-position: center !important; /* จัดตำแหน่งตรงกลางเสมอ */
    display: block !important;
    transition: transform 0.5s ease;
    padding: 0 !important;
    margin: 0 !important;
    transform: scale(1.01) !important; /* ขยายเล็กน้อยเพื่อป้องกันขอบขาว */
}

.main-hero-slider-container .swiper-slide:hover img {
    transform: scale(1.05) !important;
    transition: transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important; /* เพิ่มความนุ่มนวลของ animation */
    filter: brightness(1.05) !important; /* เพิ่มความสว่างเล็กน้อยเมื่อ hover */
}

.main-hero-slider-container .swiper-slide::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.2) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Responsive Design for Full-Width Hero Slider */
/* Desktop large screens */
@media (min-width: 1600px) {
    #main-hero-slider,
    .main-hero-slider-container,
    .main-hero-slider-container .swiper-slide {
        height: 600px; /* เพิ่มความสูงให้มากขึ้น */
        width: 100vw;
        margin: 0;
        padding: 0;
    }
}

/* Desktop normal screens - default size is 450px set above */

/* Tablets */
@media (max-width: 991px) {
    #main-hero-slider,
    .main-hero-slider-container,
    .main-hero-slider-container .swiper-slide {
        height: 450px; /* เพิ่มความสูงให้มากขึ้น */
        width: 100vw;
        margin: 0;
        padding: 0;
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    #main-hero-slider,
    .main-hero-slider-container,
    .main-hero-slider-container .swiper-slide {
        height: 400px; /* เพิ่มความสูงให้มากขึ้น */
        width: 100vw;
        margin: 0;
        padding: 0;
        border-radius: 0;
    }

    .swiper-button-next,
    .swiper-button-prev {
        display: none !important;
    }

    .swiper-pagination {
        bottom: 15px !important;
    }

    .swiper-pagination-bullet {
        width: 10px !important;
        height: 10px !important;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    #main-hero-slider,
    .main-hero-slider-container,
    .main-hero-slider-container .swiper-slide {
        height: 350px; /* เพิ่มความสูงให้มากขึ้น */
        width: 100vw;
        margin: 0;
        padding: 0;
        border-radius: 0;
    }

    .swiper-pagination {
        bottom: 10px !important;
    }

    .swiper-pagination-bullet {
        width: 8px !important;
        height: 8px !important;
    }
}

/* Styles for configurable hero slider to stay within .container (legacy support) */
.section-content-area.container .swiper-container.configurable-hero-slider {
    width: 100%; /* Make swiper-container full width of its parent .container */
    margin-left: auto;
    margin-right: auto;
    padding-left: 0 !important; /* Override any inherited padding */
    padding-right: 0 !important; /* Override any inherited padding */
    overflow: hidden; /* Clip any potential overflow from swiper-wrapper/slides */
}

.section-content-area.container .swiper-container.configurable-hero-slider .swiper-wrapper,
.section-content-area.container .swiper-container.configurable-hero-slider .swiper-slide {
    width: 100% !important; /* Ensure wrapper and slides are 100% of the constrained swiper-container */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

/* Ensure Swiper navigation buttons are visible and accessible */
.swiper-button-next, .swiper-button-prev {
    color: #007bff; /* Or your preferred color - คุณสามารถเปลี่ยนสีได้ตามต้องการ */
    background-color: rgba(255, 255, 255, 0.8); /* เพิ่มความทึบของพื้นหลังเล็กน้อย */
    border-radius: 50%;
    width: 44px;  /* กำหนดความกว้าง (ค่าเดิมของ Swiper คือ 44px) */
    height: 44px; /* กำหนดความสูงให้เท่ากับความกว้าง */
    display: flex; /* เพิ่มเพื่อให้ align-items และ justify-content ทำงาน */
    align-items: center; /* จัดให้ icon อยู่ตรงกลางแนวตั้ง */
    justify-content: center; /* จัดให้ icon อยู่ตรงกลางแนวนอน */
    transition: background-color 0.2s ease; /* เพิ่ม transition ให้สวยงาม */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* เพิ่มเงาเล็กน้อย (ทางเลือก) */
}

.swiper-button-next:hover, .swiper-button-prev:hover {
    background-color: rgba(255, 255, 255, 1); /* พื้นหลังทึบขึ้นเมื่อ hover */
}

.swiper-button-next::after, .swiper-button-prev::after {
    font-size: 1rem; /* ปรับขนาด icon ให้เล็กลงเล็กน้อยเพื่อให้สมดุลกับปุ่มขนาด 44px */
                     /* ค่าเดิม 1.2rem อาจจะใหญ่ไปนิดสำหรับปุ่ม 44px */
}

.swiper-pagination-bullet-active {
    background: #007bff !important;
}

/* Footer Styles */
.main-footer {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.6;
    width: 100%;
    margin: 0 auto;
}

.footer-newsletter-bar {
    background-color: #007bff; /* Blue similar to Advice */
    color: #ffffff;
    padding: 1.25rem 0;
    width: 100%;
}

.footer-newsletter-bar .newsletter-prompt {
    font-weight: 500;
}

.footer-newsletter-bar .form-control-sm {
    border-radius: 0.2rem;
}

.footer-newsletter-bar .btn-primary {
    background-color: #0056b3; /* Darker blue for button */
    border-color: #0056b3;
}

.footer-newsletter-bar .btn-primary:hover {
    background-color: #004085;
    border-color: #00376e;
}

.footer-main-content {
    background-color: #f8f9fa; /* Light grey, similar to Advice main footer area */
    padding: 3.5rem 2rem 2.5rem 2rem;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    width: 100%;
    margin-top: 20px;
}

.footer-main-content .container {
    padding-left: 30px;
    padding-right: 30px;
}

.footer-main-content .footer-col {
    margin-bottom: 1.5rem; /* Space between columns on smaller screens */
    padding-left: 15px;
    padding-right: 15px;
}

.footer-main-content .footer-heading {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
}

.footer-links li {
    margin-bottom: 0.4rem;
}

.footer-links a {
    color: #555;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #007bff;
    text-decoration: underline;
}

#footer-shop-description-text {
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

#footer-contact-info-block p {
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

#footer-contact-info-block i {
    width: 16px; /* Ensure icons align well */
}

.footer-verified-logo {
    max-height: 35px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.footer-verified-logo:hover {
    opacity: 1;
}

.footer-social-icon {
    display: inline-block;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    border-radius: 50%;
    background-color: #e0e0e0;
    color: #333;
    font-size: 1rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.footer-social-icon:hover {
    background-color: #007bff;
    color: #ffffff;
}

.footer-copyright-bar {
    background-color: #343a40; /* Dark grey/black, similar to Advice */
    color: #adb5bd; /* Light grey text */
    padding: 1rem 0;
    font-size: 0.8rem;
}

.footer-copyright-bar p {
    margin-bottom: 0;
}

/* Scroll to Top Button (already styled inline, but can add more here if needed) */
#scroll-to-top-btn:hover {
    background-color: #0056b3 !important; /* Darker blue on hover */
}

/* Product Grid Layout */
.product-grid {
  --product-grid-gap: clamp(28px, 3vw, 36px);
  --product-card-min: clamp(220px, 17vw, 240px);
  width: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--product-card-min, clamp(220px, 17vw, 240px)), 1fr));
  gap: var(--product-grid-gap, clamp(28px, 3vw, 36px));
  align-items: stretch;
}

.product-grid .product-card-wrapper {
  width: 100%;
  min-width: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

@media (min-width: 1600px) {
  .product-grid {
    --product-card-min: clamp(152px, 8.8vw, 176px);
  }
}

@media (max-width: 1199.98px) {
  .product-grid {
    --product-card-min: clamp(136px, 19.2vw, 176px);
  }
}

@media (max-width: 991.98px) {
  .product-grid {
    --product-card-min: clamp(128px, 30.4vw, 168px);
  }
}

@media (max-width: 767.98px) {
  .product-grid {
    --product-grid-gap: clamp(22px, 5vw, 28px);
    --product-card-min: 100%;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .product-grid .product-card-wrapper {
    margin: 0;
  }
}

/* เพิ่ม: สำหรับหน้าจอที่เล็กมาก */
@media (max-width: 480px) {
  .product-grid {
    --product-grid-gap: clamp(18px, 6vw, 24px);
  }

  .product-grid .product-card-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0.3rem 0 !important;
  }

  /* แก้ไข card ใน mobile */
  .product-grid .product-card-wrapper .card {
    margin: 0 !important;
    width: 100% !important;
  }

  /* แก้ไข image ใน mobile */
  .product-grid .product-card-wrapper .card-img-top-wrapper {
    aspect-ratio: 16/9; /* เปลี่ยนเป็น 16:9 สำหรับมือถือ */
    padding: 8px;
  }

  /* แก้ไข text ใน mobile - compact like product grid */
  .product-grid .product-card-wrapper .card-title {
  font-size: 10px !important;
  line-height: 1.35;
  font-weight: 600;
  color: #1f2937;
  }

  .product-grid .product-card-wrapper .card-text {
  /* font-size controlled by enhanced-product-cards.css: 11px */
  /* line-height controlled by enhanced-product-cards.css: 1.35 */
  }
}

.product-grid .product-card-wrapper .card {
    width: 100%; /* Make the card take full width of its wrapper */
    height: 100%; /* Make the card take full height of its wrapper if product-card-wrapper is display:flex */
}

/* Responsive product images with aspect ratio */
.product-grid .product-card-wrapper .card-img-top-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: var(--product-card-aspect-desktop, 4 / 3);
  height: auto;
  min-height: clamp(112px, 14.4vw, 208px);
  overflow: hidden;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  box-sizing: border-box;
}

.product-grid .product-card-wrapper .card-img-top {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.product-grid .product-card-wrapper .card:hover .card-img-top {
  transform: scale(1.06);
    filter: brightness(1.1);
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .product-grid .product-card-wrapper .card-img-top-wrapper {
  /* Keep mobile visuals comfortable; allow 16:9 wrapper if defined elsewhere */
  padding: 10px;
    }

    .product-grid .product-card-wrapper .card:hover .card-img-top {
        transform: scale(1.05);
    }
}

/* Placeholder image styling */
.product-grid .product-card-wrapper .card-img-top[src*="no-image.svg"] {
    opacity: 0.8;
    filter: grayscale(20%);
}

.product-grid .product-card-wrapper .card:hover .card-img-top[src*="no-image.svg"] {
    opacity: 1;
    filter: grayscale(0%);
}

/* Promotion chips under product image (global) */
.promotion-chips { display:flex; gap:6px; align-items:center; margin: 6px 8px 2px; flex-wrap: wrap; }
.promotion-chip { background:#111827; color:#fff; border-radius:999px; padding:4px 8px; font-size:11px; font-weight:700; line-height:1; display:flex; align-items:center; gap:6px; }
.promotion-chip .chip-icon { font-size: 12px; line-height: 1; }
.promotion-chip.chip--coupon { background:#0ea5e9; }
.promotion-chip.chip--discount { background:#f97316; }
.promotion-chip.chip--category_discount { background:#9333ea; }
.promotion-chip.chip--buy_x_get_y { display: none !important; visibility: hidden !important; }
.promotion-chip.chip--more { background:#374151; }

/* Overlay placement variant (inside image wrapper, bottom-left) */
.promotion-chips.promotion-chips--overlay {
  position: absolute;
  left: 8px;
  bottom: 8px;
  margin: 0;
  z-index: 7;
}
.promotion-chips.promotion-chips--below { margin-top: 6px; }

/* Small badge under card body to indicate discount promos */
.promo-discount-badge { margin-top: 6px; }
.promo-discount-badge .badge { cursor: pointer; font-weight: 700; border-radius: 999px; padding: 6px 10px; }
.bs-popover-auto, .popover { max-width: 280px; }

/* Thin right-aligned promotion line under price */
.promo-discount-line { display: flex; justify-content: flex-end; margin: 6px 0 8px; }
.promo-discount-line .promo-line-text {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: #0f5132;
  background: linear-gradient(90deg, rgba(25,135,84,0.08), rgba(25,135,84,0.16));
  border: 1px solid rgba(25,135,84,0.35); border-radius: 6px; padding: 4px 8px; cursor: pointer;
}
.promo-discount-line .promo-line-text::before{ content: none; }

/* Brand badge on product card (top-right) */
.brand-logo-badge,
.brand-text-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255,255,255,0.95);
  color: #111827;
  padding: 6px 10px;
  border-radius: 999px;
  z-index: 8;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  border: 1px solid rgba(0,0,0,0.05);
  font-weight: 700;
  font-size: 12px;
}
.brand-logo-badge .brand-logo-img { width: 28px; height: 20px; object-fit: contain; display: block; }


/* Adjustments for Product Carousel to ensure it doesn't conflict */
/* if .product-carousel-slider also uses .product-card-wrapper,
   these flex styles might affect it. We might need to make
   the flex styles more specific if there's an issue. */

/* ... existing code ... */

/* Product Carousel Styles */
.product-carousel-slider {
    width: 100%;
    margin: auto;
    overflow: hidden !important;
    padding: 0 !important; /* Explicitly set padding to 0 */
    position: relative;
}

.product-carousel-slider .swiper-slide {
    display: flex; /* Helps with card height consistency if cards have varying content */
    align-items: stretch; /* Make slides stretch to same height if using flex */
}

.product-carousel-slider .product-card-wrapper {
    width: 100%; /* Ensure card wrapper takes full width of the slide */
  margin: 0 !important; /* Remove all margins so only spaceBetween controls spacing */
    display: flex; /* Make wrapper a flex container */
    flex-direction: column; /* Stack card content vertically */
}

.product-carousel-slider .card {
    flex-grow: 1; /* Allow card to grow to fill the slide height */
}

/* Swiper navigation uses default styles; removed empty override rulesets */

.product-carousel-slider .swiper-pagination-bullet-active {
    background-color: #007bff; /* Example color */
}

/* Styles for dynamic content sections within the 80% wrapper */
.homepage-section {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 2.5rem; /* Add some vertical spacing between sections */
    /* background-color: rgba(0,255,0,0.1); */ /* Optional: for debugging bounds */
}

.section-content-area {
    /* Default padding for content areas, using Bootstrap gutter variable */
    padding-left: calc(var(--bs-gutter-x, 1.5rem) * .5);
    padding-right: calc(var(--bs-gutter-x, 1.5rem) * .5);
    /* width: 100%;  block elements are 100% by default  */
    /* box-sizing: border-box;  Good practice, Bootstrap usually includes this  */
}

/* For product_grid and product_carousel sections, make their content areas zero-padded
   to allow their content (grid/carousel) to manage full width up to the edges. */
.homepage-section[data-section-type="product_grid"] > .section-content-area,
.homepage-section[data-section-type="product_carousel"] > .section-content-area {
    padding-left: 0;
    padding-right: 0;
}

/* For product_grid rows within a zero-padded .section-content-area,
   The gx-0 class on the row itself should now handle gutters.
   The following rules are now commented out. */

/*
.homepage-section[data-section-type="product_grid"] .product-grid.row {
    margin-left: 0;
    margin-right: 0;
}

.homepage-section[data-section-type="product_grid"] .product-grid.row > .product-card-wrapper:first-child {
    padding-left: 0 !important;
}

.homepage-section[data-section-type="product_grid"] .product-grid.row > .product-card-wrapper:last-child {
    padding-right: 0 !important;
}
*/

/* Product Carousel Card Alignment Fixes */
.product-carousel-slider .card {
    display: flex; /* Make the card itself a flex container */
    flex-direction: column; /* Stack its children (img-wrapper, card-body) vertically */
    height: 100%; /* Ensure card fills the height of the swiper-slide (which has align-items: stretch) */
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    overflow: hidden; /* Prevent content from breaking card boundaries */
}

.product-carousel-slider .card-img-top-wrapper {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    flex-shrink: 0;
}

.product-carousel-slider .card-img-top {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.product-carousel-slider .card:hover .card-img-top {
    transform: scale(1.08);
    filter: brightness(1.1);
}

/* Placeholder styling for carousel */
.product-carousel-slider .card-img-top[src*="no-image.svg"] {
    opacity: 0.8;
    filter: grayscale(20%);
}

.product-carousel-slider .card:hover .card-img-top[src*="no-image.svg"] {
    opacity: 1;
    filter: grayscale(0%);
}

.product-carousel-slider .card-body {
    display: flex;
    flex-direction: column; /* Stack title, text, price, buttons vertically */
    flex-grow: 1; /* Allow card-body to take up remaining vertical space in the card */
    padding: 0.8rem; /* Or your preferred card padding */
}

.product-carousel-slider .card-title {
    font-family: 'Prompt', 'Kanit', sans-serif;
  font-size: 10px !important;
  font-weight: 600;

.product-carousel-slider .card-text { /* Optional description */
    font-size: 0.8rem;
    line-height: 1.4;
    color: #6c757d;
    margin-bottom: 0.5rem;
    /* No min-height to allow it to be absent or short */
    max-height: 4.2em; /* Approx 3 lines (3 * 1.4em), adjust if needed */
    overflow: hidden;
    text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3; /* Limit description to 3 lines if present */
  line-clamp: 3;
    -webkit-box-orient: vertical;
    /* No flex-grow here, rely on btn-group margin-top: auto */
}

.product-carousel-slider .card-price {
    font-size: 1rem;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 0.6rem;
    /* Price will sit above the buttons pushed to the bottom */
}

.product-carousel-slider .btn-group {
    margin-top: auto; /* THIS IS KEY: Pushes button group to the bottom of the card-body */
}
/* End Product Carousel Card Alignment Fixes */

/* Ensure there are no trailing malformed comments or rules after this point */

/* Product Badges Styling */
.product-card-wrapper .card {
    position: relative; /* Needed for absolute positioning of badges */
    overflow: hidden; /* Optional: Helps if badges are styled to go slightly outside bounds */
}

.product-badges {
    position: absolute;
    top: 8px; /* ��Ѻ仵��˹���� */
    left: 8px;
    z-index: 9;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
    max-width: 150px;
}

.product-badges .badge {
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: bold;
    color: #fff;
    border-radius: 0.25rem;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.2);
}
/* Hide textual brand line to save vertical space (logo overlay remains) */
.product-card-wrapper .brand-line { display: none !important; }

/* Optional tuning variables (can be overridden in index.html :root) */
:root {
  --pc-title-base: 0.95rem; /* base title size before scaling */
  --pc-title-scale: 0.7;    /* 0.7 ≈ reduce ~30% */
}

.product-badges .new-arrival-badge {
    background-color: #198754;
}

.product-badges .best-seller-badge {
    background-color: #ffc107; /* Yellow */
    color: #212529;
    animation: blinkAnimation 2s infinite; /* Added blinking animation */
}

.product-badges .ai-feature-badge {
    background-color: #007bff; /* Blue */
    color: white;
    padding: 0.3em 0.6em;
    border-radius: 0.25rem;
    font-size: 0.75em;
    margin-right: 0.3em;
    margin-bottom: 0.3em;
    display: inline-block;
}

.product-badges .ict-feature-badge {
    background-color: #28a745; /* Green */
    color: white;
    padding: 0.3em 0.6em;
    border-radius: 0.25rem;
    font-size: 0.75em;
    margin-right: 0.3em;
    margin-bottom: 0.3em;
    display: inline-block;
}

.product-badges .express-delivery-badge {
  background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
  color: #f8fafc;
  padding: 0.25em 0.6em;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-right: 0.3em;
  margin-bottom: 0.3em;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}

.product-badges .copilot-pc-badge {
    background: linear-gradient(135deg, #0078D4 0%, #00BCF2 100%);
    color: white;
    padding: 0.3em 0.6em;
    border-radius: 0.25rem;
    font-size: 0.75em;
    font-weight: 600;
    margin-right: 0.3em;
    margin-bottom: 0.3em;
    display: inline-block;
}

.card-img-top-wrapper {
    position: relative;
}

.product-card-wrapper .card .btn-group {
    width: 100%;
}

.product-card-wrapper .card .btn-group .btn, /* Targeting buttons within the btn-group */
.product-card-wrapper .card .btn { /* Fallback for direct buttons if any */
    white-space: nowrap; /* Prevent text from wrapping to a new line */
    overflow: hidden; /* Hide overflow if text is still too long */
    text-overflow: ellipsis; /* Show ... if text overflows */
    /* font-size: 0.8rem; /* Optional: uncomment and adjust if text is still too long for the button width */
    /* padding: 0.3rem 0.4rem; /* Optional: uncomment and adjust padding if needed */
}

.product-card-wrapper .card-price-original {
    text-decoration: line-through;
  font-size: 0.85em;
    color: #6c757d;
  margin-bottom: 0.15rem;
}

.product-card-wrapper .card-price-online {
  font-size: 1.15em;
    font-weight: bold;
    color: #dc3545;
  margin-bottom: 0.15rem;
}

.product-card-wrapper .card-price {
  font-size: 1.0em;
    font-weight: bold;
  margin-bottom: 0.3rem;
}

/* Price row: keep price on the left and promo badge on the right */
.product-card-wrapper .price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Compact promo/discount badge shown next to price (right side) */
.product-card-wrapper .promo-badge-right {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: linear-gradient(135deg, #fb923c, #f97316);
  box-shadow: 0 2px 6px rgba(249,115,22,.25);
  white-space: nowrap;
}

/* Slightly tone down on very small screens */
@media (max-width: 420px) {
  .product-card-wrapper .promo-badge-right {
    font-size: 11px;
    padding: 2px 6px;
  }
}

.product-card-wrapper .discount-badge-wrapper {
    text-align: center;
    margin-bottom: 0.5rem;
}

.product-card-wrapper .discount-badge {
    background-color: #ffc107;
    color: #212529;
    padding: 0.3em 0.75em;
    border-radius: 0.25rem;
    font-size: 0.9em;
    font-weight: bold;
    display: inline-block;
    animation: yellowBlinkFade 4s infinite;
}

@keyframes yellowBlinkFade {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.2;
    }
}

.product-card-wrapper .online-price-remark {
    font-size: 0.75em;
    color: #6c757d;
    text-align: center;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

.product-card-wrapper .card-body .mt-auto {
    padding-top: 0.5rem;
}

/* Font-size controlled by enhanced-product-cards.css only */
.product-card-wrapper .card-title {
    margin-bottom: 0.5rem;
    /* Clamp to 2 lines to keep titles from bloating card height */
    display: -webkit-box;
  line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  line-height: 1.3;
  min-height: calc(1.3em * 2);
    /* Compact title size for product cards */
    /* font-size: 11px !important; */
    font-weight: 600;
    color: #1f2937;
}
/* Font-size �ͧ .card-text �١�Ǻ����� enhanced-product-cards.css (11px) ��� inline CSS ���� */
.product-card-wrapper .card-text {
  margin-bottom: 0.5rem;
  /* font-size: 16px !important; */ /* �١ź����������� 11px �ҡ enhanced-product-cards.css */
  /* line-height: 1.6; */ /* �١ź����������� 1.35 �ҡ enhanced-product-cards.css */
  color: #4b5563;
}
.product-grid .product-card-wrapper .card.h-100 { height: auto !important; }

/* Limit spec list growth so it doesn't balloon card height */
body.desktop-locked .product-grid .product-card-wrapper .product-specs,
.product-grid .product-card-wrapper .product-specs {
  max-height: none;
  overflow: visible;
}

/* Guarantee specs/desc are smaller than 12px title within product cards */
.product-card-wrapper .product-specs,
.product-card-wrapper .product-specs-line {
  font-size: 11px !important;
  line-height: 1.5 !important;
  overflow: visible !important;
}

/* product-desc ��� product-description �١�Ǻ����� enhanced-product-cards.css ���� */
/* ����� override ����� */
.product-card-wrapper .product-desc,
.product-card-wrapper .product-description {
  /* ���Ҩҡ enhanced-product-cards.css: 11px, line-height 1.35, 3 lines */
}

/* Card body layout equalizer: make content fill and keep CTA aligned at the bottom */
.product-card-wrapper .card {
  display: flex;
  flex-direction: column;
  /* Cap height to avoid outliers; tune via CSS var */
  max-height: var(--pc-card-max-height, 440px);
  overflow: hidden;
}
.product-card-wrapper .card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 6px 10px;
}
.product-card-wrapper .card .btn-group {
  margin-top: auto;
}

/* Promo/meta text sizing: make online-only notes fully visible */
.product-card-wrapper .price-block {
  display: grid;
  grid-template-columns: 1fr auto; /* meta left, price right */
  gap: 4px 8px;
  align-items: end;
}
.product-card-wrapper .meta-col {
  display: none !important; /* ��͹ meta column ������ */
  visibility: hidden !important;
  opacity: 0 !important;
}
.product-card-wrapper .meta-col .meta-line {
  white-space: normal;      /* allow wrapping */
  overflow: visible;        /* no clipping */
  text-overflow: clip;      /* no ellipsis */
}
.product-card-wrapper .meta-col .meta-line.online-only {
  color: #0ea5e9;           /* sky-500 */
  font-weight: 500;
  font-size: calc(var(--pc-meta-font-size, 12px) - 1px);
}
.product-card-wrapper .meta-col .meta-line.express-delivery {
  display: none !important; /* ��͹��ͤ����Ѵ�觵ç��ҧ */
  visibility: hidden !important;
  opacity: 0 !important;
}
.product-card-wrapper .meta-col .meta-line.free-ship {
  display: none !important; /* ��͹��ͤ����觿�յç��ҧ */
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Small price note under price */
.product-card-wrapper .price-note {
  margin-top: 4px;
  font-size: var(--pc-price-note-size, 11px);
  line-height: 1.2;
  color: #6b7280; /* gray-500 */
}

/* Compact pills and stats so they don't push content down */
.product-card-wrapper .price-pills {
  display: none !important; /* źᶺ����ͷͧ�͡ */
}

.product-card-wrapper .price-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px !important;
  border-radius: 6px;
  background: #f1f5f9;
  color: #334155;
  font-size: 10px !important;
  font-weight: 600 !important;
  line-height: 1.4;
  white-space: nowrap;
}

.product-card-wrapper .price-pill.warranty-pill {
  background: #dcfce7;
  color: #15803d;
}

.product-card-wrapper .price-pill.express-delivery-pill {
  background: #fef3c7;
  color: #d97706;
  font-weight: 700;
}

.product-card-wrapper .price-pill.shipping-pill {
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 600;
}

.product-card-wrapper .price-pill.zero-installment {
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  color: white;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.product-card-wrapper .price-pill.zero-installment .installment-value {
  color: #fef3c7;
  font-size: 11px;
  font-weight: 800;
}

.product-card-wrapper .stat-footer,
.product-card-wrapper .view-count-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

.product-card-wrapper .view-count-footer i {
  color: #cbd5e1;
  font-size: 12px;
}

/* Slightly tighter on 1366px and below */
@media (max-width: 1366px) {
  .product-card-wrapper .meta-col { font-size: 11px; line-height: 1.2; }
  .product-card-wrapper .meta-col .meta-line.online-only { font-size: 10px; }
  .product-card-wrapper .price-note { font-size: 10px; }
}

/* Desktop-locked mode: ensure consistent 5-column grid and image box sizing everywhere (global, not just index) */
body.desktop-locked .product-grid {
  display: grid !important;
  grid-template-columns: repeat(var(--desktop-grid-cols, 5), 1fr) !important;
  grid-auto-rows: auto !important;
  column-gap: var(--desktop-col-gap, clamp(16px, 2vw, 28px)) !important;
  row-gap: var(--desktop-row-gap, clamp(18px, 2.5vw, 32px)) !important;
  width: 100% !important;
}
body.desktop-locked .product-grid .product-card-wrapper {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}
body.desktop-locked .product-grid .product-card-wrapper .card {
  height: auto !important;
  max-height: var(--pc-card-max-height, 440px);
}
body.desktop-locked .product-grid .product-card-wrapper .card-img-top-wrapper {
  width: 100% !important;
  aspect-ratio: var(--product-card-aspect-desktop, 4 / 3) !important;
  height: auto !important;
  min-height: clamp(140px, 18vw, 260px) !important;
  margin: 0 auto !important;
  padding: 10px !important;
}

/* 0% installment badge: compact single-line chip, no extra vertical gaps */
.zero-percent-installment-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #ef4444; /* highlight 0% */
  margin: 2px 0 4px;
}
.zero-percent-installment-badge .installment-text { color: #64748b; font-weight: 500; }
.zero-percent-installment-badge .installment-value { color: #ef4444; }

.product-card-wrapper .card {
    position: relative;
    overflow: hidden;
}

.product-card-brand-overlay {
  position: absolute;
  top: 10px;
  right: 10px; /* ����仢����� */
  left: auto; /* ¡��ԡ left */
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  max-width: 90px;
  max-height: 35px;
  overflow: hidden;
}

.product-card-brand-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 56px;
  max-height: 26px;
  object-fit: contain;
  padding: 0;
}

.product-card-brand-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: #333;
    display: block;
    text-transform: uppercase;
}

/* 0% Installment Badge Styles */
.zero-percent-installment-badge {
    text-align: right; /* Align to the right as in the image */
    margin-bottom: 0.75rem; /* Space below it */
    margin-top: 0.5rem; /* Space above it */
    animation: blinkAnimation 2s infinite; /* Added blinking animation */
}

.zero-percent-installment-badge .installment-text {
    font-size: 1em; /* Adjust as needed */
    color: #28a745; /* Green color for "ผ่อน" */
    font-weight: bold;
    margin-right: 0.25em;
}

.zero-percent-installment-badge .installment-value {
    font-size: 1.8em; /* Larger size for "0%" */
    color: #dc3545; /* Red color for "0%" */
    font-weight: bold;
    line-height: 1; /* Adjust line height to prevent excessive space */
}
/* End 0% Installment Badge Styles */

@keyframes blinkAnimation {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Admin Dashboard Specific Styles */
/* ... existing code ... */

/* @keyframes pulse removed as it was a duplicate of one defined earlier */

/* Added to Cart Modal Styles */
#addedToCartModal .modal-dialog {
    max-width: 800px; /* Wider modal for more content */
}

#addedToCartModal .modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

#addedToCartModal .modal-title {
    font-size: 1.25rem;
    font-weight: 500;
}

/* Main product added to cart */
#addedToCartModal #main-added-product-modal-content .product-item {
    display: flex;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    /* border-bottom: 1px solid #eee; */ /* Removed as there's an <hr> already */
}

#addedToCartModal #main-added-product-modal-content .product-image {
    width: 100px; /* Increased size */
    height: 100px; /* Increased size */
    object-fit: contain; /* Ensure full image is visible, no cropping */
    margin-right: 1rem;
    border: 1px solid #eee;
    border-radius: 4px;
}

#addedToCartModal #main-added-product-modal-content .product-details h6 {
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

#addedToCartModal #main-added-product-modal-content .product-details p.price {
    margin-bottom: 0;
    font-size: 1rem; /* Increased size */
    color: #dc3545; /* Bootstrap danger color for price */
    font-weight: bold;
}

/* Recommended Products Section */
#addedToCartModal #recommended-products-modal-content {
    /* Uses Bootstrap row/col, so gap is handled by g-3. Grid not strictly needed here. */
    max-height: 300px; /* Limit height and make scrollable */
    overflow-y: auto;
    margin-bottom: 1rem;
    padding: 0.5rem; /* Padding around the scroll area */
    background-color: #f9f9f9; /* Slight background for the scroll area */
    border-radius: 4px;
}

#addedToCartModal #recommended-products-modal-content .card {
    border: 1px solid #ddd;
    transition: box-shadow 0.2s ease;
}
#addedToCartModal #recommended-products-modal-content .card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#addedToCartModal #recommended-products-modal-content .card-img-top-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1; /* Square aspect ratio for image container */
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Ensure image doesn't break container */
}

#addedToCartModal #recommended-products-modal-content .card-img-top {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Important for fitting image without distortion */
}

#addedToCartModal #recommended-products-modal-content .card-body {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
}

#addedToCartModal #recommended-products-modal-content .card-title {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.3;
    min-height: 2.6em; /* Approx 2 lines */
    overflow: hidden;
    text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 0.5rem;
}

#addedToCartModal #recommended-products-modal-content .card-text.price {
    font-size: 0.95rem;
    font-weight: bold;
    color: #28a745; /* Bootstrap success color */
    margin-bottom: 0.5rem;
}

#addedToCartModal #recommended-products-modal-content .form-check {
    margin-top: auto; /* Push checkbox to bottom of card-body */
}
#addedToCartModal #recommended-products-modal-content .form-check-input {
    transform: scale(1.2);
    margin-right: 0.5rem;
}
#addedToCartModal #recommended-products-modal-content .form-check-label {
    font-size: 0.85rem;
}


/* Totals Display */
#addedToCartModal #cart-total-modal-display,
#addedToCartModal #modal-subtotal-value {
    font-weight: bold;
}

/* Footer buttons */
#addedToCartModal .modal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

#addedToCartModal .modal-footer > div { /* Wrapper for right-aligned buttons */
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap; /* Allow buttons in group to wrap too */
}

#addedToCartModal .modal-footer .btn {
    flex-grow: 1; /* Allow buttons to grow */
    min-width: 150px; /* Ensure buttons have decent minimum width */
}

/* Cart Page Specific Styles */
#main-content .cart-item-row .item-checkbox {
    transform: scale(1.2); /* Make checkbox slightly larger */
}

#main-content .cart-item-row img {
    max-height: 80px; /* Adjust image size */
    width: auto;
    object-fit: contain;
    border: 1px solid #eee;
}

#main-content .cart-item-row .item-name {
    font-size: 0.95rem;
    font-weight: 500;
}

#main-content .cart-item-row .item-price-each {
    font-size: 0.9rem;
}

#main-content .cart-item-row .item-price-total {
    font-size: 1rem;
}

#main-content .quantity-control {
    max-width: 120px; /* Ensure it fits well */
}

#main-content .quantity-control .form-control {
    height: calc(1.5em + .5rem + 2px); /* BS sm button height */
    padding: .25rem .5rem;
    font-size: .875rem;
}
#main-content .quantity-control .btn {
    padding: .25rem .5rem;
    font-size: .875rem;
    line-height: 1.5;
}


#main-content .summary-card {
    position: sticky;
    top: 20px; /* Adjust as needed based on your header height */
    z-index: 1019; /* Below header dropdowns (1020 for Bootstrap dropdowns) but above normal content */
}

#main-content .summary-card .card-title {
    font-size: 1.25rem; /* Slightly larger title for summary */
}

#main-content .summary-card .form-label {
    margin-bottom: 0.25rem; /* Tighter spacing for discount label */
}

#main-content .summary-card .btn-lg {
    padding: 0.6rem 1rem; /* Slightly adjust padding for lg buttons if needed */
}

#main-content #empty-cart-display-new i {
    font-size: 3.5rem; /* Larger icon for empty cart */
}

#main-content #empty-cart-display-new h4 {
    font-weight: 500;
}

#main-content .cart-items-list-container .cart-item-row:last-child {
    border-bottom: none !important; /* Remove border from the very last item if it's the only one*/
}

/* Ensure consistent font sizes in summary */
#main-content .summary-card span,
#main-content .summary-card small,
#main-content .summary-card .form-label {
    font-size: 0.9rem;
}
#main-content .summary-card .h5 span {
    font-size: 1.15rem; /* For grand total */
}
#main-content .summary-card #summary-grand-total {
     color: #dc3545; /* Highlight grand total */
}

/* Cart responsive adjustments */
@media (max-width: 1200px) {
  #main-content .cart-item-row {
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-start;
  }

  #main-content .cart-item-row .flex-grow-1 {
    flex-basis: calc(100% - 140px);
  }

  #main-content .cart-item-row .flex-shrink-0.mx-3,
  #main-content .cart-item-row .flex-shrink-0.text-end,
  #main-content .cart-item-row .flex-shrink-0:last-child {
    flex-basis: auto;
  }
}

@media (max-width: 768px) {
  #main-content .cart-item-row {
    flex-direction: column;
    align-items: stretch;
  }

  #main-content .cart-item-row > .flex-shrink-0,
  #main-content .cart-item-row > .flex-grow-1 {
    width: 100% !important;
    flex-basis: 100% !important;
  }

  #main-content .cart-item-row .text-end {
    text-align: left !important;
  }

  #main-content .quantity-control {
    max-width: 100%;
    width: 100%;
  }

  #main-content .summary-card {
    position: static;
    margin-top: 1.5rem;
  }
}

/* Styling for select all / remove selected header */
#main-content .card.shadow-sm.mb-3 .card-body > .d-flex.justify-content-between {
    font-size: 0.9rem;
}
#main-content #select-all-items {
    accent-color: var(--bs-primary); /* Use theme color for checkbox */
}

/* Product Detail Page - Main Image Gallery Fix - Re-applying Stricter Containment */
#product-image-gallery-main {
    width: 100%;
    height: 450px; /* Explicit, fixed height for the viewport */
    overflow: hidden !important; /* Force clipping of overflowing children */
    position: relative;
    padding: 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%); /* Clean gradient background */
    border-radius: 12px; /* Rounded corners */
    box-shadow: 0 4px 20px rgba(0,0,0,0.08); /* Elegant shadow */
    box-sizing: border-box;
    margin-bottom: 10px;
}

#product-image-gallery-main .swiper-wrapper {
    width: 100%;
    height: 100%;
    display: flex; /* Ensure flex behavior for alignment */
}

#product-image-gallery-main .swiper-slide {
    flex-shrink: 0; /* Prevent slides from shrinking if content is too large */
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Secondary clipping at slide level */
    box-sizing: border-box;
    background-color: #ffffff; /* White background for slide content area */
    text-align: center; /* Fallback for older browsers */
}

#product-image-gallery-main .swiper-slide img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto; /* Helps center if aspect ratio makes it smaller than slide bounds */
}

/* Thumbnails basic styling (can be expanded) */
#product-image-gallery-thumbs .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    height: 80px; /* Example fixed height for thumbs */
    border: 1px solid #dee2e6;
    cursor: pointer;
    background-color: #fff;
    padding: 2px; /* Small padding around the thumb image */
    box-sizing: border-box;
}

#product-image-gallery-thumbs .swiper-slide img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

#product-image-gallery-thumbs .swiper-slide-thumb-active {
    border-color: #0d6efd; /* Bootstrap primary blue, or your theme's primary color */
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

/* Custom styles for the main shop logo in the header */
#shop-logo-main {
  max-width: 250px !important;  /* กำหนดความกว้างสูงสุด */
  max-height: 250px !important; /* กำหนดความสูงสูงสุด */
  width: auto; /* ให้เบราว์เซอร์ปรับความกว้างอัตโนมัติเพื่อรักษาสัดส่วน */
  height: auto; /* ให้เบราว์เซอร์ปรับความสูงอัตโนมัติเพื่อรักษาสัดส่วน */
  object-fit: contain; /* ป้องกันไม่ให้รูปภาพบิดเบี้ยวหรือถูกตัด ถ้าสัดส่วนไม่พอดี */
}

/* Avatar styles for consistent sizing */
.customer-avatar {
  width: 40px !important;
  height: 40px !important;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid #ddd;
}

#header-user-avatar {
  width: 30px !important;
  height: 30px !important;
  object-fit: cover;
}

#user-profile-img {
  max-width: 80px !important;
  max-height: 80px !important;
  object-fit: cover;
  border-radius: 50% !important;
  border: 2px solid #ddd !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.3s ease !important;
}

#user-profile-img:hover {
  transform: scale(1.05) !important;
  border-color: #1976d2 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Avatar preview in forms */
#avatar-preview, #profile-avatar-display {
  max-width: 100px !important;
  max-height: 100px !important;
  object-fit: cover;
  border-radius: 50% !important;
  border: 2px solid #ddd !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.3s ease !important;
}

#avatar-preview:hover, #profile-avatar-display:hover {
  transform: scale(1.02) !important;
  border-color: #1976d2 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Employee photo in admin */
.employee-photo {
  width: 40px !important;
  height: 40px !important;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid #ddd;
}

/* Ensure Configurable Hero images are responsive and cover their area */
.configurable-hero-section .configurable-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block; /* Remove extra space below image if it's inline */
}

/* Optional: If the hero section itself needs a specific aspect ratio or height */
/* (Stray comment placeholder removed) */

/* Tab Menu V2 (Secondary Navigation) Link Styling */
nav#main-nav #main-nav-container a.nav-link {
    font-size: 0.7rem; /* Further reduced font size to 0.7rem */
    white-space: nowrap; /* Prevent text from wrapping */
    padding-top: 0.4rem;    /* Adjusted vertical padding */
    padding-bottom: 0.4rem; /* Adjusted vertical padding */
    /* If horizontal space is also tight, you could adjust padding-left/right if needed */
}

/* Styling for the Main Hero Slider */
/* ... existing code ... */

/* Logo Strip Styles */
.logo-strip-items-container {
    display: flex;
    flex-wrap: nowrap;
    overflow: hidden;
    padding: 10px 0;
    align-items: center;
}

.logo-strip-item {
    flex-shrink: 0;
    margin-right: 20px;
    text-align: center;
}

.logo-strip-item img.logo-strip-image {
    max-height: 60px;
    max-width: 150px;
    object-fit: contain;
    vertical-align: middle;
}

/* Placeholder for cloned items removed (no styles needed) */

/* Styles for Configurable Hero Section ID 39 - Random Shuffle Animation */
#section-wrapper-39 .section-content-area > .row { /* Target the .row direct child of content-area */
    position: relative;
    /* We will set min-height via JS later based on calculated grid height */
}

#section-wrapper-39 .hero-item-col {
    position: absolute; /* Crucial for manual positioning */
    /* Width and height will be set via JS based on column count and container width */
    /* Example transition, can be adjusted */
    transition: top 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55),
                left 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55),
                opacity 0.5s ease-in-out;
    opacity: 1; /* Start visible */
}

/* .hero-item-col.shuffling-active placeholder removed (no additional styles) */

/* ===== SEARCH ENHANCEMENTS ===== */
.search-bar {
  position: relative;
  z-index: 10;
}

.search-bar input {
  position: relative;
  z-index: 11;
}

.search-bar button {
  position: relative;
  z-index: 12 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

.search-bar.search-focused {
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
  background: #ffffff;
}

.search-suggestions {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  right: 0 !important;
  background: white !important;
  border: 1px solid #e9ecef !important;
  border-top: none !important;
  border-radius: 0 0 12px 12px !important;
  max-height: 300px !important;
  overflow-y: auto !important;
  z-index: 9999 !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
  display: none !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-width: 100% !important;
}

.search-suggestions.show {
  display: block !important;
}

.search-suggestion-item {
  padding: 12px 16px !important;
  border-bottom: 1px solid #f8f9fa !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  background: white !important;
  display: block !important;
  width: 100% !important;
}

.search-suggestion-item:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: white !important;
}

.search-suggestion-item:last-child {
  border-bottom: none !important;
}

/* Search button specific styles */
#search-button-main {
  background: var(--primary-accent) !important;
  border: none !important;
  color: white !important;
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.3s ease !important;
  cursor: pointer !important;
  z-index: 15 !important;
  pointer-events: auto !important;
}

#search-button-main:hover {
  background: var(--secondary-accent) !important;
  transform: scale(1.05) !important;
}

#search-button-main:active {
  transform: scale(0.95) !important;
}

#search-button-main.loading {
  opacity: 0.7 !important;
}

.search-bar button.loading {
  background: var(--gradient-primary);
  opacity: 0.8;
  cursor: not-allowed;
}

.search-bar button.loading i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Search Results Styles */
.search-results-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: var(--shadow-light);
}

.search-results-header h2 {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

/* ===== LIVE SEARCH SUGGESTIONS ===== */
.live-search-suggestions {
  position: fixed !important;
  background: white !important;
  border: 2px solid #007bff !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 25px rgba(0,0,0,0.3) !important;
  z-index: 999999 !important;
  max-height: 400px !important;
  overflow-y: auto !important;
  display: none !important;
  min-width: 300px !important;
}

.live-search-suggestions.show {
  display: block !important;
}

.live-search-item {
  padding: 12px 16px !important;
  border-bottom: 1px solid #f0f0f0 !important;
  cursor: pointer !important;
  transition: background-color 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
}

.live-search-item:hover {
  background-color: #f8f9fa !important;
}

.live-search-item:last-child {
  border-bottom: none !important;
}

.live-search-item img {
  width: 50px !important;
  height: 50px !important;
  object-fit: cover !important;
  border-radius: 4px !important;
  margin-right: 12px !important;
}

.live-search-item-info {
  flex: 1 !important;
}

.live-search-item-name {
  font-family: 'Noto Sans Thai', 'Prompt', 'Kanit', sans-serif !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  color: #1a1a1a !important;
  text-rendering: optimizeLegibility !important;
  margin-bottom: 4px !important;
}

.live-search-item-categories {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  font-family: 'Noto Sans Thai', 'Prompt', 'Kanit', sans-serif !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  color: #5f6f85 !important;
}

.live-search-item-category-row {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 6px !important;
  margin-bottom: 6px !important;
}

.live-search-category-link,
.live-search-category-label {
  font-family: 'Noto Sans Thai', 'Prompt', 'Kanit', sans-serif !important;
  font-size: 0.8rem !important;
  display: inline-flex !important;
  align-items: center !important;
  min-height: 26px !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  border: 1px solid transparent !important;
  line-height: 1.2 !important;
}

.live-search-category-link {
  color: #215fcf !important;
  background: rgba(33, 95, 207, 0.1) !important;
  border-color: rgba(33, 95, 207, 0.2) !important;
  text-decoration: none !important;
  cursor: pointer !important;
}

.live-search-category-link:hover {
  color: #0f4cb5 !important;
  background: rgba(33, 95, 207, 0.16) !important;
  border-color: rgba(33, 95, 207, 0.3) !important;
}

.live-search-category-label {
  color: #5f6f85 !important;
  background: rgba(95, 111, 133, 0.08) !important;
  border-color: rgba(95, 111, 133, 0.12) !important;
}

.live-search-category-separator {
  display: none !important;
}

.live-search-item-category-extra {
  font-family: 'Noto Sans Thai', 'Prompt', 'Kanit', sans-serif !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  color: #1d6fd8 !important;
  display: inline-flex !important;
  align-items: center !important;
  min-height: 26px !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  background: rgba(29, 111, 216, 0.12) !important;
}

.live-search-item-category-count {
  font-family: 'Noto Sans Thai', 'Prompt', 'Kanit', sans-serif !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  color: #7b8798 !important;
  display: inline-flex !important;
  align-items: center !important;
  min-height: 26px !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  background: rgba(123, 135, 152, 0.12) !important;
}

.live-search-item-price {
  font-family: 'Kanit', 'Prompt', sans-serif !important;
  color: #e74c3c !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  text-rendering: optimizeLegibility !important;
}

/* ===== CATEGORY PRODUCTS PAGE ===== */
.category-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 2rem 0;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.category-header h1 {
  color: var(--primary-accent);
  font-weight: 600;
}

.category-stats .badge {
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
}

.filter-sort-bar {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  border: 1px solid #e9ecef;
}

.filter-sort-bar .form-label {
  font-weight: 500;
  color: #495057;
  margin-right: 0.5rem;
}

.filter-sort-bar .form-select {
  border-radius: 8px;
  border: 1px solid #ced4da;
  transition: all 0.3s ease;
}

.filter-sort-bar .form-select:focus {
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* ===== NEW LIST-STYLE PRODUCT LAYOUT (BaNANA Style) ===== */
.product-list-item {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  margin-bottom: 1rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.product-list-item:hover {
  border-color: var(--primary-accent);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.product-list-content {
  width: 100%;
}

.product-image-small {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border-radius: 8px;
  overflow: hidden;
  padding: 8px;
}

.product-image-small img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 4px;
  transition: transform 0.3s ease;
}

.product-list-item:hover .product-image-small img {
  transform: scale(1.05);
}

.product-info {
  padding-left: 1rem;
}

.product-info .product-name {
  font-size: 1.35rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.5rem;
  line-height: 1.45;
}

.product-info .product-description {
  font-size: 16px;
  color: #4b5563;
  margin-bottom: 0.5rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-info .product-meta {
  margin-top: 0.5rem;
}

.product-info .product-category {
  font-size: 0.8rem;
  color: #888;
  background: #f8f9fa;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
}

.product-actions {
  text-align: right;
  padding-left: 1rem;
}

.product-actions .price-section {
  margin-bottom: 1rem;
}

.product-actions .current-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-accent);
}

.product-actions .add-to-cart-btn {
  background: linear-gradient(135deg, var(--primary-accent) 0%, var(--secondary-accent) 100%);
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.2rem;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.product-actions .add-to-cart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* Responsive for List Layout */
@media (max-width: 768px) {
  .product-list-item {
    padding: 1rem;
  }

  .product-info {
    padding-left: 0;
    margin-top: 1rem;
  }

  .product-actions {
    padding-left: 0;
    text-align: left;
    margin-top: 1rem;
  }

  .product-actions .add-to-cart-btn {
    width: 100%;
  }
}

/* Product Cards for Category Page */
.product-card-wrapper {
  flex: 1 1 280px;
  min-width: 250px;
  max-width: 300px;
  margin: 0 0.5rem 1rem 0.5rem;
}

.product-card {
  border: 1px solid #e9ecef;
  border-radius: 12px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  border-color: var(--primary-accent);
}

.product-image-container {
  position: relative;
  overflow: hidden;
  height: 200px;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

.product-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-card:hover .product-overlay {
  opacity: 1;
}

.product-name {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-description {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #4b5563;
}

.current-price {
  color: var(--primary-accent) !important;
  font-weight: 600;
}

.add-to-cart-btn {
  background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%) !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 0.35rem 0.7rem !important;
  font-weight: 600 !important;
  font-size: 0.75rem !important;
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  line-height: 1.2 !important;
  transition: all 0.3s ease;
  color: #fff !important;
  box-shadow: 0 2px 4px rgba(8, 145, 178, 0.3) !important;
}

.add-to-cart-btn:hover {
  background: linear-gradient(135deg, #0e7490 0%, #155e75 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(8, 145, 178, 0.4) !important;
}

/* Products Grid Layout */
.products-section {
  min-height: 400px;
}

.product-grid {
  display: flex;
  flex-wrap: wrap;
  margin: 0; /* remove negative margins for flush layout */
}

/* Grid View Layout */
.product-grid:not(.list-view) {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
}

/* Pagination Styles */
.pagination {
  margin-top: 2rem;
}

.page-link {
  border-radius: 8px;
  margin: 0 0.2rem;
  border: 1px solid #dee2e6;
  color: var(--primary-accent);
  transition: all 0.3s ease;
}

.page-link:hover {
  background-color: var(--primary-accent);
  border-color: var(--primary-accent);
  color: white;
}

.page-item.active .page-link {
  background-color: var(--primary-accent);
  border-color: var(--primary-accent);
}

/* ===== DYNAMIC GRID COLUMNS FOR GRID VIEW ===== */
.product-grid:not(.list-view).grid-2 .product-card-wrapper {
  flex: 0 0 50% !important;
  max-width: 50% !important;
}

.product-grid:not(.list-view).grid-3 .product-card-wrapper {
  flex: 0 0 33.333% !important;
  max-width: 33.333% !important;
}

.product-grid:not(.list-view).grid-4 .product-card-wrapper {
  flex: 0 0 25% !important;
  max-width: 25% !important;
}

.product-grid:not(.list-view).grid-5 .product-card-wrapper {
  flex: 0 0 20% !important;
  max-width: 20% !important;
}

.product-grid:not(.list-view).grid-6 .product-card-wrapper {
  flex: 0 0 16.666% !important;
  max-width: 16.666% !important;
}

/* ===== LIST VIEW SPECIFIC ===== */
.product-grid.list-view {
  flex-direction: column;
  margin: 0;
}

.product-grid.list-view .product-list-item {
  width: 100%;
  margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .category-header {
    padding: 1.5rem 0;
    text-align: center;
  }

  .filter-sort-bar {
    padding: 1rem;
  }

  .filter-sort-bar .row {
    text-align: center;
  }

  .filter-sort-bar .col-md-6 {
    margin-bottom: 1rem;
  }

  .product-card-wrapper {
    flex: 1 1 100%;
    max-width: 100%;
    margin: 0 0 1rem 0;
  }

  .product-grid {
    margin: 0;
  }
}

@media (min-width: 576px) and (max-width: 767px) {
  .product-card-wrapper {
    flex: 1 1 calc(50% - 1rem);
    max-width: calc(50% - 1rem);
  }
}

@media (min-width: 992px) {
  .product-card-wrapper {
    flex: 1 1 calc(25% - 1rem);
    max-width: calc(25% - 1rem);
  }
}

/* ===== RESPONSIVE GRID ADJUSTMENTS FOR GRID VIEW ===== */
@media (max-width: 1200px) {
  .product-grid:not(.list-view).grid-6 .product-card-wrapper {
  flex: 0 0 20% !important;
  max-width: 20% !important;
  }

  .product-grid:not(.list-view).grid-5 .product-card-wrapper {
  flex: 0 0 25% !important;
  max-width: 25% !important;
  }
}

@media (max-width: 992px) {
  .product-grid:not(.list-view).grid-5 .product-card-wrapper,
  .product-grid:not(.list-view).grid-6 .product-card-wrapper {
  flex: 0 0 33.333% !important;
  max-width: 33.333% !important;
  }

  .product-grid:not(.list-view).grid-4 .product-card-wrapper {
  flex: 0 0 33.333% !important;
  max-width: 33.333% !important;
  }
}

@media (max-width: 768px) {
  .product-grid:not(.list-view).grid-3 .product-card-wrapper,
  .product-grid:not(.list-view).grid-4 .product-card-wrapper,
  .product-grid:not(.list-view).grid-5 .product-card-wrapper,
  .product-grid:not(.list-view).grid-6 .product-card-wrapper {
  flex: 0 0 50% !important;
  max-width: 50% !important;
  }
}

@media (max-width: 576px) {
  .product-grid:not(.list-view).grid-2 .product-card-wrapper,
  .product-grid:not(.list-view).grid-3 .product-card-wrapper,
  .product-grid:not(.list-view).grid-4 .product-card-wrapper,
  .product-grid:not(.list-view).grid-5 .product-card-wrapper,
  .product-grid:not(.list-view).grid-6 .product-card-wrapper {
  flex: 0 0 100% !important;
  max-width: 100% !important;
  }
}

/* ===== NEW COMPACT CARD LAYOUT (List View) ===== */
.product-list-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.product-list-card:hover {
  border-color: var(--primary-accent);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.product-image-compact {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.75rem;
  padding: 8px;
}

.product-image-compact img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 4px;
  transition: transform 0.3s ease;
}

.product-list-card:hover .product-image-compact img {
  transform: scale(1.05);
}

.product-info-compact {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-name-compact {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: #2c3e50;
  text-rendering: optimizeLegibility;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-description-compact {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  color: #6c757d;
  text-rendering: optimizeLegibility;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-meta-compact {
  margin-bottom: 0.5rem;
}

.product-category-compact {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  color: #6c757d;
  text-rendering: optimizeLegibility;
  background: #f8f9fa;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  display: inline-block;
}

.product-price-compact {
  margin-bottom: 0.5rem;
  margin-top: auto;
}

.current-price-compact {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #dc3545;
  text-rendering: optimizeLegibility;
}

.add-to-cart-btn-compact {
  background: linear-gradient(135deg, var(--primary-accent) 0%, var(--secondary-accent) 100%);
  border: none;
  border-radius: 5px;
  padding: 0.5rem 0.8rem;
  font-weight: 500;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.add-to-cart-btn-compact:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(52, 152, 219, 0.3);
}

/* ===== LIST VIEW SPECIFIC (1 row per product, full width) ===== */
.product-grid.list-view {
  display: block;
  width: 100%;
  margin: 0;
}

.product-grid.list-view .product-list-item {
  width: 100%;
  margin-bottom: 1rem;
  display: block;
}

/* Grid View uses these column classes */

/* ===== LIST VIEW LAYOUT (Full width rows) ===== */
.product-list-item {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  margin-bottom: 1rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  width: 100%;
  display: block;
}

.product-list-item:hover {
  border-color: var(--primary-accent);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.product-list-content {
  width: 100%;
}

.product-list-content .row {
  width: 100%;
  margin: 0;
}

.product-image-small {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border-radius: 8px;
  overflow: hidden;
}

.product-image-small img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.product-info {
  padding-left: 1rem;
}

.product-info .product-name {
  font-size: 1.35rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.5rem;
  line-height: 1.45;
}

.product-info .product-description {
  font-size: 16px;
  color: #4b5563;
  margin-bottom: 0.5rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-info .product-meta {
  margin-top: 0.5rem;
}

.product-info .product-category {
  font-size: 0.8rem;
  color: #888;
  background: #f8f9fa;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
}

.product-actions {
  text-align: right;
  padding-left: 1rem;
}

.product-actions .price-section {
  margin-bottom: 1rem;
}

.product-actions .current-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-accent);
}

.product-actions .add-to-cart-btn {
  background: linear-gradient(135deg, var(--primary-accent) 0%, var(--secondary-accent) 100%);
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.2rem;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.product-actions .add-to-cart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* Responsive for List Layout */
@media (max-width: 768px) {
  .product-list-item {
    padding: 1rem;
  }

  .product-info {
    padding-left: 0;
    margin-top: 1rem;
  }

  .product-actions {
    padding-left: 0;
    text-align: left;
    margin-top: 1rem;
  }

  .product-actions .add-to-cart-btn {
    width: 100%;
  }

  /* Responsive for compact cards in Grid View */
  .product-grid.grid-3 .product-card-wrapper,
  .product-grid.grid-4 .product-card-wrapper,
  .product-grid.grid-5 .product-card-wrapper,
  .product-grid.grid-6 .product-card-wrapper {
    flex: 1 1 calc(50% - 1rem) !important;
    max-width: calc(50% - 1rem) !important;
  }
}

@media (max-width: 576px) {
  .product-grid.grid-2 .product-card-wrapper,
  .product-grid.grid-3 .product-card-wrapper,
  .product-grid.grid-4 .product-card-wrapper,
  .product-grid.grid-5 .product-card-wrapper,
  .product-grid.grid-6 .product-card-wrapper {
    flex: 1 1 calc(100% - 1rem) !important;
    max-width: calc(100% - 1rem) !important;
  }
}

/* Product Card Fonts - Updated with Google Fonts (Prompt & Kanit) */
.product-card-wrapper .card-title {
  margin-bottom: 0.45rem;
  font-family: 'Prompt', 'Kanit', sans-serif;
  font-size: 14px !important;
  font-weight: 600;
  line-height: 1.25;
  color: #1f2937;
  text-rendering: optimizeLegibility;
}

/* Font-size �ͧ .card-text �١�Ǻ����� enhanced-product-cards.css (11px) ��� inline CSS ���� */
.product-card-wrapper .card-text {
  margin-bottom: 0.5rem;
  font-family: 'Prompt', 'Kanit', sans-serif;
  /* font-size: 14px !important; */ /* �١ź��������ʴ� 3 ��÷Ѵ��� - �� 11px �ҡ enhanced-product-cards.css */
  font-weight: 400;
  /* line-height: 1.5; */ /* �١ź����������� 1.35 �ҡ enhanced-product-cards.css */
  color: #4b5563;
  text-rendering: optimizeLegibility;
}

.product-card-wrapper .card-price {
    font-family: 'Noto Sans Thai', 'Noto Sans', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #e74c3c;
    text-rendering: optimizeLegibility;
}

.product-card-wrapper .card-price-original {
    font-family: 'Noto Sans Thai', 'Noto Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    color: #6c757d;
    text-decoration: line-through;
    text-rendering: optimizeLegibility;
}

.product-card-wrapper .card-price-online {
    font-family: 'Noto Sans Thai', 'Noto Sans', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #28a745;
    text-rendering: optimizeLegibility;
}

/* Product Carousel Slider Fonts */
.product-carousel-slider .card-title {
    font-family: 'Prompt', 'Kanit', sans-serif;
  font-size: 14px !important;
  font-weight: 600;
  line-height: 1.25;
    color: #1f2937;
    text-rendering: optimizeLegibility;
    margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: calc(1.25em * 2);
}

.product-carousel-slider .card-text { /* Optional description */
    font-family: 'Prompt', 'Kanit', sans-serif;
  font-size: 14px;
    font-weight: 400;
  line-height: 1.5;
  color: #4b5563;
    text-rendering: optimizeLegibility;
    margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: calc(1.5em * 2);
}

.product-carousel-slider .card-price {
    font-family: 'Noto Sans Thai', 'Noto Sans', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #e74c3c;
    text-rendering: optimizeLegibility;
    margin-bottom: 0.75rem;
}

/* Product Info Fonts for List View */
.product-info .product-name {
    font-family: 'Prompt', 'Kanit', sans-serif;
  font-size: 1.35rem; /* No change */
  font-weight: 600;
  line-height: 1.45; /* No change */
  color: #1f2937; /* No change */
    text-rendering: optimizeLegibility;
    margin-bottom: 0.5rem;
}

.product-info .product-description {
    font-family: 'Prompt', 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: #4b5563;
    text-rendering: optimizeLegibility;
    margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Product Actions Price */
.product-actions .current-price {
    font-family: 'Kanit', 'Prompt', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #e74c3c;
    text-rendering: optimizeLegibility;
}

/* Generic Product Name and Description */
.product-name {
    font-family: 'Prompt', 'Kanit', sans-serif;
  font-size: 1.35rem; /* No change */
  font-weight: 600; /* No change */
  line-height: 1.45; /* No change */
  color: #1f2937; /* No change */
    text-rendering: optimizeLegibility;
    margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-description {
    font-family: 'Prompt', 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: #4b5563;
    text-rendering: optimizeLegibility;
    margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.current-price {
    font-family: 'Kanit', 'Prompt', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #e74c3c;
    text-rendering: optimizeLegibility;
}

/* Global Font Settings with Google Fonts */
body {
    font-family: 'Prompt', 'Kanit', sans-serif;
    font-weight: 400;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Kanit', 'Prompt', sans-serif;
    font-weight: 600;
    text-rendering: optimizeLegibility;
}

/* Header and Navigation Fonts */
#shop-name-display {
    font-family: 'Kanit', 'Prompt', sans-serif;
    font-weight: 700;
    text-rendering: optimizeLegibility;
}

.brand-tagline {
    font-family: 'Prompt', 'Kanit', sans-serif;
    font-weight: 400;
    text-rendering: optimizeLegibility;
}

.main-nav a {
    font-family: 'Prompt', 'Kanit', sans-serif;
    font-weight: 500;
    text-rendering: optimizeLegibility;
}

/* Category Header Fonts */
.category-header h1 {
    font-family: 'Kanit', 'Prompt', sans-serif;
    font-weight: 700;
    text-rendering: optimizeLegibility;
}

.category-header p {
    font-family: 'Prompt', 'Kanit', sans-serif;
    font-weight: 400;
    text-rendering: optimizeLegibility;
}

.category-stats .badge {
    font-family: 'Kanit', 'Prompt', sans-serif;
    font-weight: 600;
    text-rendering: optimizeLegibility;
}

/* Filter and Sort Bar Fonts */
.filter-sort-bar .form-label {
    font-family: 'Prompt', 'Kanit', sans-serif;
    font-weight: 500;
    text-rendering: optimizeLegibility;
}

.filter-sort-bar .form-select {
    font-family: 'Prompt', 'Kanit', sans-serif;
    font-weight: 400;
    text-rendering: optimizeLegibility;
}

.view-mode-toggle label {
    font-family: 'Prompt', 'Kanit', sans-serif;
    font-weight: 500;
    text-rendering: optimizeLegibility;
}

/* Breadcrumb Fonts */
.breadcrumb-item {
    font-family: 'Prompt', 'Kanit', sans-serif;
    font-weight: 400;
    text-rendering: optimizeLegibility;
}

.breadcrumb-item a {
    font-family: 'Prompt', 'Kanit', sans-serif;
    font-weight: 500;
    text-rendering: optimizeLegibility;
}

/* Button Fonts */
.btn {
    font-family: 'Prompt', 'Kanit', sans-serif;
    font-weight: 500;
    text-rendering: optimizeLegibility;
}

.add-to-cart-btn {
    font-family: 'Kanit', 'Prompt', sans-serif;
    font-weight: 600;
    text-rendering: optimizeLegibility;
}

/* Top Bar Fonts */
.top-bar {
    font-family: 'Prompt', 'Kanit', sans-serif;
    font-weight: 400;
    text-rendering: optimizeLegibility;
}

.top-bar a {
    font-family: 'Prompt', 'Kanit', sans-serif;
    font-weight: 500;
    text-rendering: optimizeLegibility;
}

/* Header Actions Fonts */
.header-actions a {
    font-family: 'Prompt', 'Kanit', sans-serif;
    font-weight: 500;
    text-rendering: optimizeLegibility;
}

/* Search Bar Fonts */
.search-bar input {
    font-family: 'Prompt', 'Kanit', sans-serif;
    font-weight: 400;
    text-rendering: optimizeLegibility;
}

.search-bar .category-select {
    font-family: 'Prompt', 'Kanit', sans-serif;
    font-weight: 400;
    text-rendering: optimizeLegibility;
}

/* ปรับปรุงการแสดงผลปุ่มค้นหาและ avatar ในส่วนหัว */

/* Header Avatar - ปรับขนาดให้เหมาะสม */
#header-user-avatar {
  width: 40px !important;
  height: 40px !important;
  object-fit: cover;
  border-radius: 50% !important;
  border: 2px solid rgba(255, 255, 255, 0.8) !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15) !important;
  transition: all 0.3s ease !important;
  margin-right: 8px !important;
}

#header-user-avatar:hover {
  transform: scale(1.1) !important;
  border-color: rgba(255, 255, 255, 1) !important;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25) !important;
}

/* Header Actions - ปรับการจัดเรียง */
.header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 1.5rem !important;
  height: 100% !important;
}

.header-actions a {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  color: #ffffff !important;
  text-decoration: none !important;
  padding: 8px 12px !important;
  border-radius: 8px !important;
  transition: all 0.3s ease !important;
  font-weight: 500 !important;
}

.header-actions a:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  transform: translateY(-1px) !important;
}

/* Header User Info */
#header-user-info {
  display: flex !important;
  align-items: center !important;
  gap: 1rem !important;
}

#header-username-link {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 6px 12px !important;
  border-radius: 25px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

#header-username-link:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
}

#header-username {
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  color: #ffffff !important;
}

/* Search Button - ปรับขนาดให้สมดุลกับ avatar */
#search-button-main {
  width: 50px !important;
  height: 50px !important;
  background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%) !important;
  border: none !important;
  border-radius: 0 12px 12px 0 !important;
  color: white !important;
  font-size: 18px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 15px rgba(25, 118, 210, 0.3) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#search-button-main:hover {
  background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(25, 118, 210, 0.4) !important;
}

#search-button-main:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 10px rgba(25, 118, 210, 0.3) !important;
}

/* Search Input - ปรับให้เข้ากับปุ่มค้นหา */
#search-input-main {
  height: 50px !important;
  border: 2px solid #e0e0e0 !important;
  border-right: none !important;
  border-radius: 12px 0 0 12px !important;
  padding: 0 20px !important;
  font-size: 16px !important;
  transition: all 0.3s ease !important;
  background: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

#search-input-main:focus {
  outline: none !important;
  border-color: #1976d2 !important;
  box-shadow: 0 4px 15px rgba(25, 118, 210, 0.2) !important;
}

/* Category Select - ปรับให้เข้ากับ search bar */
.category-select {
  height: 50px !important;
  border: 2px solid #e0e0e0 !important;
  border-right: 1px solid #e0e0e0 !important;
  border-radius: 12px 0 0 12px !important;
  padding: 0 15px !important;
  background: #f8f9fa !important;
  font-size: 14px !important;
  color: #495057 !important;
  min-width: 120px !important;
  transition: all 0.3s ease !important;
}

.category-select:focus {
  outline: none !important;
  border-color: #1976d2 !important;
  background: #ffffff !important;
}

/* Search Bar Container */
.search-bar {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  max-width: 600px !important;
  margin: 0 auto !important;
  position: relative !important;
}

/* Cart Link - ปรับให้สวยงาม */
.cart-link {
  position: relative !important;
  padding: 10px 15px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border-radius: 25px !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  backdrop-filter: blur(10px) !important;
}

.cart-link:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
}

.cart-badge {
  position: absolute !important;
  top: -5px !important;
  right: -5px !important;
  background: #ff4444 !important;
  color: white !important;
  border-radius: 50% !important;
  width: 22px !important;
  height: 22px !important;
  font-size: 11px !important;
  font-weight: bold !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
}

/* Logout Button */
#header-logout-button {
  padding: 6px 12px !important;
  font-size: 0.85rem !important;
  border-radius: 20px !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  background: transparent !important;
  color: #ffffff !important;
  transition: all 0.3s ease !important;
}

#header-logout-button:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  color: #ffffff !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  #header-user-avatar {
    width: 35px !important;
    height: 35px !important;
  }

  #search-button-main {
    width: 45px !important;
    height: 45px !important;
    font-size: 16px !important;
  }

  #search-input-main {
    height: 45px !important;
    font-size: 14px !important;
  }

  .category-select {
    height: 45px !important;
    font-size: 13px !important;
    min-width: 100px !important;
  }

  .header-actions {
    gap: 1rem !important;
  }

  #header-username {
    display: none !important;
  }
}

@media (max-width: 480px) {
  #header-user-avatar {
    width: 28px !important;
    height: 28px !important;
  }

  #search-button-main {
    width: 38px !important;
    height: 38px !important;
  }

  .header-actions a span {
    display: none !important;
  }

  .search-bar {
    border-radius: 20px !important;
  }

  .search-bar input {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.85rem !important;
  }
}

/* Responsive Design สำหรับ Header */
@media (max-width: 992px) {
  .search-bar {
    max-width: 500px !important;
  }

  .category-select {
    min-width: 100px !important;
    font-size: 13px !important;
  }

  #search-input-main {
    font-size: 15px !important;
  }

  .header-actions {
    gap: 1.2rem !important;
  }
}

@media (max-width: 768px) {
  #header-user-avatar {
    width: 35px !important;
    height: 35px !important;
  }

  #search-button-main {
    width: 45px !important;
    height: 45px !important;
    font-size: 16px !important;
  }

  #search-input-main {
    height: 45px !important;
    font-size: 14px !important;
    padding: 0 15px !important;
  }

  .category-select {
    height: 45px !important;
    font-size: 13px !important;
    min-width: 90px !important;
    padding: 0 10px !important;
  }

  .header-actions {
    gap: 1rem !important;
  }

  #header-username {
    display: none !important;
  }

  .search-bar {
    max-width: 100% !important;
  }

  .header-center {
    flex: 1 !important;
    margin: 0 1rem !important;
  }
}

@media (max-width: 576px) {
  #header-user-avatar {
    width: 32px !important;
    height: 32px !important;
    margin-right: 6px !important;
  }

  #search-button-main {
    width: 42px !important;
    height: 42px !important;
    font-size: 14px !important;
  }

  #search-input-main {
    height: 42px !important;
    font-size: 13px !important;
    padding: 0 12px !important;
  }

  .category-select {
    height: 42px !important;
    font-size: 12px !important;
    min-width: 80px !important;
    padding: 0 8px !important;
  }

  .header-actions {
    gap: 0.8rem !important;
  }

  .header-actions a {
    padding: 6px 10px !important;
    font-size: 0.8rem !important;
  }

  .cart-link span:not(.cart-badge) {
    display: none !important;
  }

  #header-logout-button {
    padding: 4px 8px !important;
    font-size: 0.75rem !important;
  }

  .header-center {
    margin: 0 0.5rem !important;
  }
}

/* ปรับปรุง Header Layout ให้สมดุลและสวยงาม */

/* Main Header Container */
.main-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0.5rem 1rem !important;
  min-height: 70px !important;
  position: relative !important;
}

/* Header Left - Logo */
.header-left {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  min-width: 150px !important;
}

.header-left .logo img {
  max-height: 50px !important;
  width: auto !important;
  object-fit: contain !important;
}

/* Header Center - Search */
.header-center {
  flex: 1 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  max-width: 500px !important;
  margin: 0 1rem !important;
  min-width: 300px !important;
}

.search-container {
  width: 100% !important;
  max-width: 450px !important;
  position: relative !important;
}

/* Header Right - User Actions */
.header-right {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.8rem !important;
  min-width: 200px !important;
  justify-content: flex-end !important;
}

/* Search Bar ปรับปรุง */
.search-bar {
  display: flex !important;
  align-items: center !important;
  background: rgba(255, 255, 255, 0.95) !important;
  border-radius: 25px !important;
  padding: 0 !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  transition: all 0.3s ease !important;
  height: 44px !important;
  width: 100% !important;
}

.search-bar:focus-within {
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.2) !important;
  transform: translateY(-1px) !important;
}

.category-select {
  border: none !important;
  background: transparent !important;
  padding: 0 12px !important;
  height: 44px !important;
  border-radius: 25px 0 0 25px !important;
  font-size: 13px !important;
  color: #333 !important;
  min-width: 80px !important;
  outline: none !important;
}

#search-input-main {
  flex: 1 !important;
  border: none !important;
  background: transparent !important;
  padding: 0 15px !important;
  height: 44px !important;
  font-size: 14px !important;
  color: #333 !important;
  outline: none !important;
}

#search-button-main {
  width: 44px !important;
  height: 44px !important;
  border: none !important;
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
  color: white !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 16px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 3px 10px rgba(0, 123, 255, 0.3) !important;
  margin-right: 2px !important;
}

#search-button-main:hover {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%) !important;
  box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4) !important;
  transform: translateY(-1px) !important;
}

#search-button-main:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3) !important;
}

/* Header User Info - ปรับปรุงการแสดงผล */
#header-user-info {
  display: flex !important;
  align-items: center !important;
  gap: 0.8rem !important;
  flex-wrap: nowrap !important;
}

#header-username-link {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  text-decoration: none !important;
  color: white !important;
  padding: 0.3rem 0.8rem !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(10px) !important;
  transition: all 0.3s ease !important;
  white-space: nowrap !important;
  min-width: 0 !important;
  max-width: 150px !important;
}

#header-username-link:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  transform: translateY(-1px) !important;
  color: white !important;
}

#header-username {
  font-size: 14px !important;
  font-weight: 500 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  max-width: 80px !important;
}

#header-logout-button {
  background: rgba(220, 53, 69, 0.9) !important;
  color: white !important;
  border: none !important;
  padding: 0.4rem 0.8rem !important;
  border-radius: 15px !important;
  font-size: 13px !important;
  text-decoration: none !important;
  transition: all 0.3s ease !important;
  backdrop-filter: blur(10px) !important;
  white-space: nowrap !important;
}

#header-logout-button:hover {
  background: rgba(220, 53, 69, 1) !important;
  transform: translateY(-1px) !important;
  color: white !important;
}

/* Cart Link */
.cart-link {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  color: white !important;
  text-decoration: none !important;
  padding: 0.4rem 0.8rem !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(10px) !important;
  transition: all 0.3s ease !important;
  position: relative !important;
  white-space: nowrap !important;
}

.cart-link:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  transform: translateY(-1px) !important;
  color: white !important;
}

.cart-link i {
  font-size: 16px !important;
}

.cart-badge {
  background: #dc3545 !important;
  color: white !important;
  border-radius: 50% !important;
  padding: 0.2rem 0.4rem !important;
  font-size: 11px !important;
  font-weight: bold !important;
  min-width: 18px !important;
  height: 18px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* User Avatar ในส่วนหัว */
#header-user-avatar {
  width: 32px !important;
  height: 32px !important;
  object-fit: cover !important;
  border-radius: 50% !important;
  border: 2px solid rgba(255, 255, 255, 0.8) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  transition: all 0.3s ease !important;
}

#header-user-avatar:hover {
  transform: scale(1.05) !important;
  border-color: rgba(255, 255, 255, 1) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

/* Responsive Design สำหรับ Header */
@media (max-width: 1200px) {
  .header-center {
    max-width: 400px !important;
    margin: 0 0.8rem !important;
  }

  .search-container {
    max-width: 380px !important;
  }

  .header-right {
    min-width: 180px !important;
  }

  #header-username {
    max-width: 70px !important;
  }
}

@media (max-width: 992px) {
  .main-header {
    padding: 0.5rem 0.8rem !important;
    min-height: 65px !important;
  }

  .header-left {
    min-width: 120px !important;
  }

  .header-left .logo img {
    max-height: 45px !important;
  }

  .header-center {
    max-width: 350px !important;
    margin: 0 0.5rem !important;
    min-width: 250px !important;
  }

  .search-container {
    max-width: 320px !important;
  }

  .search-bar {
    height: 42px !important;
  }

  .category-select {
    height: 42px !important;
    font-size: 12px !important;
    min-width: 70px !important;
    padding: 0 10px !important;
  }

  #search-input-main {
    height: 42px !important;
    font-size: 13px !important;
    padding: 0 12px !important;
  }

  #search-button-main {
    width: 42px !important;
    height: 42px !important;
    font-size: 15px !important;
  }

  .header-right {
    gap: 0.6rem !important;
    min-width: 160px !important;
  }

  #header-username {
    font-size: 13px !important;
    max-width: 60px !important;
  }

  #header-username-link {
    padding: 0.25rem 0.6rem !important;
    max-width: 120px !important;
  }

  #header-logout-button {
    padding: 0.3rem 0.6rem !important;
    font-size: 12px !important;
  }
}

@media (max-width: 768px) {
  .main-header {
    flex-wrap: wrap !important;
    padding: 0.5rem !important;
    min-height: auto !important;
  }

  .header-left {
    order: 1 !important;
    flex: 1 !important;
    min-width: 100px !important;
  }

  .header-left .logo img {
    max-height: 40px !important;
  }

  .header-right {
    order: 2 !important;
    flex: 0 0 auto !important;
    gap: 0.5rem !important;
    min-width: 140px !important;
  }

  .header-center {
    order: 3 !important;
    flex: 1 1 100% !important;
    margin: 0.8rem 0 0.3rem 0 !important;
    max-width: none !important;
    min-width: auto !important;
  }

  .search-container {
    max-width: none !important;
  }

  .search-bar {
    height: 40px !important;
  }

  .category-select {
    height: 40px !important;
    font-size: 12px !important;
    min-width: 65px !important;
  }

  #search-input-main {
    height: 40px !important;
    font-size: 13px !important;
  }

  #search-button-main {
    width: 40px !important;
    height: 40px !important;
    font-size: 14px !important;
  }

  #header-user-avatar {
    width: 28px !important;
    height: 28px !important;
  }

  #header-username {
    font-size: 12px !important;
    max-width: 50px !important;
  }

  #header-username-link {
    padding: 0.2rem 0.5rem !important;
    max-width: 100px !important;
  }

  #header-logout-button {
    padding: 0.25rem 0.5rem !important;
    font-size: 11px !important;
  }

  .cart-link {
    padding: 0.3rem 0.6rem !important;
  }

  .cart-link i {
    font-size: 14px !important;
  }
}

@media (max-width: 576px) {
  .main-header {
    padding: 0.4rem !important;
  }

  .header-left .logo img {
    max-height: 35px !important;
  }

  .header-right {
    gap: 0.4rem !important;
    min-width: 120px !important;
  }

  .search-bar {
    height: 38px !important;
  }

  .category-select {
    height: 38px !important;
    font-size: 11px !important;
    min-width: 60px !important;
    padding: 0 8px !important;
  }

  #search-input-main {
    height: 38px !important;
    font-size: 12px !important;
    padding: 0 10px !important;
  }

  #search-button-main {
    width: 38px !important;
    height: 38px !important;
    font-size: 13px !important;
  }

  #header-user-avatar {
    width: 26px !important;
    height: 26px !important;
  }

  #header-username {
    display: none !important; /* ซ่อนชื่อผู้ใช้ในหน้าจอเล็กมาก */
  }

  #header-username-link {
    padding: 0.2rem !important;
    max-width: auto !important;
    min-width: auto !important;
  }

  #header-logout-button {
    padding: 0.2rem 0.4rem !important;
    font-size: 10px !important;
  }

  .cart-link {
    padding: 0.2rem 0.4rem !important;
  }

  .cart-link span:not(.cart-badge) {
    display: none !important; /* ซ่อนข้อความ "ตะกร้า" */
  }

  .cart-link i {
    font-size: 13px !important;
  }
}

/* ===== ENHANCED HEADER V2 STYLES ===== */
.main-header-wrapper-v2 {
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  padding: 1rem 0;
  border-bottom: 1px solid rgba(30, 60, 114, 0.08);
  box-shadow: 0 4px 25px rgba(30, 60, 114, 0.08);
  position: sticky;
  top: 0;
  z-index: 998;
  min-height: 85px;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  left: 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

@media (max-width: 1300px) {
  .main-header-wrapper-v2 {
    width: 100%;
    margin-left: 0;
    left: auto;
  }
}

.main-header-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
}

.header-layout-v2 {
  display: grid;
  grid-template-columns: 320px 1fr 380px;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  margin: 0;
  padding: 0 2rem;
  height: 100%;
  min-height: 70px;
  box-sizing: border-box;
}

/* ===== HEADER LEFT V2 ===== */
.header-left-v2 {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-self: start;
  min-width: 0;
}

.hamburger-menu-v2 {
  display: none !important; /* Force hidden - mega menu disabled */
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  border: none;
  color: white;
  padding: 0.75rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
}

.hamburger-menu-v2:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

.brand-container-v2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

.brand-container-v2:hover {
  transform: translateY(-1px);
}

#shop-logo-main-v2 {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

#shop-logo-main-v2:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.brand-text-v2 h1 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: #2c3e50;
  line-height: 1.2;
}

.brand-tagline-v2 {
  margin: 0;
  font-size: 0.8rem;
  color: #7f8c8d;
  font-weight: 500;
}

/* ===== HEADER CENTER V2 (SEARCH) ===== */
.header-center-v2 {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 0 1rem;
}

.search-container-v2 {
  position: relative;
  width: 100%;
  max-width: 650px;
}

.search-bar-v2 {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  border: 2px solid #e8ecef;
  border-radius: 30px;
  overflow: visible;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  height: 55px;
  position: relative;
}

.search-bar-v2:focus-within {
  border-color: #3498db;
  box-shadow: 0 8px 30px rgba(52, 152, 219, 0.2);
  transform: translateY(-2px);
}

.search-bar-v2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.05) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.search-bar-v2:focus-within::before {
  opacity: 1;
}

.category-select-v2 {
  border: none;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 0 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #495057;
  outline: none;
  height: 100%;
  min-width: 120px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.category-select-v2:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

#search-input-main-v2 {
  flex: 1;
  border: none;
  padding: 0 1rem;
  font-size: 0.9rem;
  color: #2c3e50;
  outline: none;
  height: 100%;
  background: transparent;
}

#search-input-main-v2::placeholder {
  color: #95a5a6;
  font-weight: 400;
}

#search-button-main-v2 {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  border: none;
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 0 40px 40px 0;
  cursor: pointer;
  transition: all 0.3s ease;
  height: auto;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 55px;
  flex-shrink: 0;
}

#search-button-main-v2:hover {
  background: linear-gradient(135deg, #2980b9 0%, #1f5f99 100%);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ===== HEADER RIGHT V2 ===== */
.header-right-v2 {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  justify-self: end;
  min-width: 0;
}

.user-menu-v2 {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.notification-btn-v2 {
  position: relative;
  background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
  border: none;
  color: white;
  padding: 0.75rem;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(243, 156, 18, 0.2);
}

.notification-btn-v2:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(243, 156, 18, 0.3);
}

.notification-badge-v2 {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #e74c3c;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.4rem;
  border-radius: 50px;
  min-width: 18px;
  text-align: center;
  animation: pulse-notification 2s infinite;
}

.notification-badge-v2:empty {
  display: none;
}

.notification-wrapper-v2 {
  position: relative;
  display: flex;
  align-items: center;
}

.notification-wrapper-v2 {
  position: relative;
  display: flex;
  align-items: center;
  z-index: 1600;
}

.notification-dropdown-v2 {
  position: absolute;
  top: calc(100% + 8px);
  bottom: auto;
  right: 0;
  width: 320px;
  background: #ffffff;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 16px;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.15);
  padding: 0;
  display: none;
  overflow: hidden;
  z-index: 3000;
  transform-origin: bottom right;
}

.notification-dropdown-v2.is-floating {
  position: fixed;
  bottom: auto;
  right: auto;
  transform-origin: bottom right;
}

.notification-dropdown-v2[data-open="true"] {
  display: block;
}

.notification-dropdown-header,
.notification-dropdown-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: #f8fafc;
}

.notification-dropdown-footer {
  justify-content: center;
}

.notification-dropdown-title {
  font-weight: 600;
  color: #1e293b;
}

.notification-mark-all-btn,
.notification-manage-btn {
  background: none;
  border: none;
  color: #0d6efd;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.notification-mark-all-btn:hover,
.notification-manage-btn:hover {
  background: rgba(13, 110, 253, 0.08);
}

.notification-dropdown-body {
  max-height: 360px;
  overflow-y: auto;
  padding: 0.5rem 0;
  background: #ffffff;
}

.notification-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 0.35rem;
}

.notification-item {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.65rem 0.65rem;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.notification-item:hover {
  background: rgba(15, 23, 42, 0.05);
  transform: translateY(-1px);
}

.notification-item.is-unread {
  background: rgba(59, 130, 246, 0.08);
}

.notification-item.is-read {
  opacity: 0.85;
}

.notification-item.is-read:hover {
  opacity: 1;
}

.notification-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #0d6efd;
  background: rgba(13, 110, 253, 0.12);
}

.notification-item-icon.order {
  color: #16a34a;
  background: rgba(22, 163, 74, 0.15);
}

.notification-item-icon.promotion {
  color: #d97706;
  background: rgba(217, 119, 6, 0.15);
}

.notification-item-icon.support {
  color: #0ea5e9;
  background: rgba(14, 165, 233, 0.15);
}

.notification-item-content h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

.notification-item-content p {
  margin: 0.25rem 0 0.35rem;
  font-size: 0.82rem;
  color: #475569;
}

.notification-item-content time {
  font-size: 0.75rem;
  color: #94a3b8;
}

.notification-unread-dot {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #0d6efd;
}

.notification-empty-state,
.notification-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2.5rem 1rem;
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
}

.notification-loading .spinner-border {
  width: 1.1rem;
  height: 1.1rem;
}

@media (max-width: 600px) {
  .notification-dropdown-v2 {
    width: min(92vw, 320px);
    right: -16px;
    top: calc(100% + 8px);
    bottom: auto;
  }
}

@keyframes pulse-notification {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.login-btn-v2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  color: white;
  text-decoration: none;
  padding: 0.75rem 1.25rem;
  border-radius: 25px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.2);
}

.login-btn-v2:hover {
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(39, 174, 96, 0.3);
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.user-info-v2 {
  position: relative;
}

.user-profile-v2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #2c3e50;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  background: linear-gradient(135deg, #ecf0f1 0%, #bdc3c7 100%);
  transition: all 0.3s ease;
  font-weight: 500;
}

.user-profile-v2:hover {
  color: #2c3e50;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#header-user-avatar-v2 {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-dropdown-v2 {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  padding: 0.5rem;
  margin-top: 0.5rem;
  min-width: 160px;
  opacity: 0;
  transform: translateY(-10px);
  visibility: hidden;
  transition: all 0.3s ease;
  border: 1px solid #e8ecef;
}

.user-info-v2:hover .user-dropdown-v2 {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.user-dropdown-v2 a {
  display: block;
  padding: 0.75rem 1rem;
  color: #2c3e50;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.user-dropdown-v2 a:hover {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
  transform: translateX(5px);
}

.cart-link-v2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
  color: white;
  text-decoration: none;
  padding: 0.75rem 1.25rem;
  border-radius: 25px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(155, 89, 182, 0.2);
  position: relative;
}

.cart-link-v2:hover {
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(155, 89, 182, 0.3);
  background: linear-gradient(135deg, #8e44ad 0%, #9b59b6 100%);
}

.cart-badge-v2 {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #e74c3c;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.4rem;
  border-radius: 50px;
  min-width: 18px;
  text-align: center;
  animation: bounce-cart 0.6s ease-in-out;
}

@keyframes bounce-cart {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* ===== HEADER V2 RESPONSIVE ===== */
@media (max-width: 1100px) {
  .header-layout-v2 {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    grid-template-columns: none;
  }

  .header-left-v2,
  .header-center-v2,
  .header-right-v2 {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
  }

  .header-left-v2 {
    justify-content: space-between;
  }

  .header-center-v2 {
    order: 3;
  }

  .header-right-v2 {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .user-menu-v2 {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .cart-link-v2 {
    margin-left: auto;
  }
}

@media (max-width: 1200px) {
  .header-layout-v2 {
    grid-template-columns: 280px 1fr 320px;
    max-width: 100%;
    padding: 0 1rem;
  }

  .brand-text-v2 h1 {
    font-size: 1.2rem;
  }

  .brand-tagline-v2 {
    font-size: 0.75rem;
  }
}

@media (max-width: 992px) {
  .header-layout-v2 {
    grid-template-columns: 250px 1fr 280px;
    gap: 0.75rem;
  }

  #shop-logo-main-v2 {
    width: 45px;
    height: 45px;
  }

  .brand-text-v2 h1 {
    font-size: 1.1rem;
  }

  .search-bar-v2 {
    height: 45px;
  }

  .category-select-v2 {
    min-width: 100px;
    font-size: 0.8rem;
  }

  .cart-text-v2 {
    display: none;
  }

  .login-btn-v2 span {
    display: none;
  }
}

@media (max-width: 768px) {
  .main-header-wrapper-v2 {
    padding: 0.8rem 0;
    min-height: 75px;
  }

  .header-layout-v2 {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0 1rem;
  }

  .header-left-v2 {
    width: 100%;
    justify-content: space-between;
    order: 1;
  }

  .hamburger-menu-v2 {
    display: flex;
    order: -1;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: none;
    color: white;
    padding: 0.8rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
  }

  .brand-container-v2 {
    flex: 1;
    justify-content: center;
    gap: 1rem;
  }

  .header-center-v2 {
    width: 100%;
    order: 3;
    padding: 0;
  }

  .search-container-v2 {
    max-width: 100%;
  }

  .search-bar-v2 {
    height: 50px;
    border-radius: 25px;
  }

  .category-select-v2 {
    min-width: 90px;
    font-size: 0.8rem;
  }

  .header-right-v2 {
    width: auto;
    order: 2;
    gap: 1rem;
  }

  .user-menu-v2 {
    gap: 1rem;
  }

  #shop-logo-main-v2 {
    width: 45px;
    height: 45px;
  }

  .brand-text-v2 h1 {
    font-size: 1.1rem;
  }

  .brand-tagline-v2 {
    font-size: 0.75rem;
  }

  .notification-btn-v2, .login-btn-v2, .cart-link-v2 {
    padding: 0.6rem 1rem;
    border-radius: 20px;
  }
}

@media (max-width: 576px) {
  .main-header-wrapper-v2 {
    padding: 0.5rem 0;
    min-height: 65px;
  }

  .header-layout-v2 {
    gap: 0.5rem;
    padding: 0 0.5rem;
  }

  .brand-text-v2 h1 {
    font-size: 0.9rem;
  }

  .brand-tagline-v2 {
    display: none;
  }

  .search-bar-v2 {
    height: 38px;
  }

  .category-select-v2 {
    min-width: 70px;
    font-size: 0.7rem;
    padding: 0 0.5rem;
  }

  #search-input-main-v2 {
    font-size: 0.8rem;
    padding: 0 0.75rem;
  }

  #search-button-main-v2 {
    padding: 0 1rem;
    font-size: 0.9rem;
  }

  .notification-btn-v2,
  .user-profile-v2,
  .cart-link-v2 {
    padding: 0.6rem;
  }

  #header-user-avatar-v2 {
    width: 32px;
    height: 32px;
  }

  #header-username-v2 {
    display: none;
  }

  .user-menu-v2 {
    gap: 0.5rem;
  }
}

/* Product Detail Page Responsive Layout - ปรับปรุงสัดส่วน */
.main-content-wrapper {
    width: var(--global-content-width, 100%);
    max-width: none;
    margin: 0;
    padding: 20px var(--page-edge-padding, 24px);
    min-height: 100vh;
}

.product-detail-container {
  width: 100% !important;
  max-width: var(--page-max-width, 1320px) !important;
  margin: 0 auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  overflow: hidden;
  padding: 20px;
}

/* ปรับสัดส่วนคอลัมน์ - ภาพซ้าย + รายละเอียด + แผงขวา */
.product-detail-row {
  /* Use grid for precise column + gap control (prevents overflow) */
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.15fr) minmax(240px, 320px);
  column-gap: 24px;
  row-gap: 24px;
  align-items: start;
  min-height: 500px;
}

/* คอลัมน์ภาพสินค้า */
.product-image-section {
  /* Grid child takes first column automatically */
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-width: 0; /* prevent overflow from large inner content */
}

/* คอลัมน์ข้อมูลสินค้า */
.product-info-section {
  /* Grid child takes second column automatically */
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0; /* allow content to shrink inside and not push layout */
}

/* Right panels column (installments + helpful links) */
.right-panels-section {
  grid-column: 3;
  min-width: 0;
  align-self: start;
}

@media (max-width: 1199.98px) {
  .product-detail-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .right-panels-section {
    grid-column: 1 / -1;
  }
}

/* Professional two-lane layout inside product info: content + right sidebar */
@media (min-width: 1400px){
  #product-info-area{
    display: grid;
    grid-template-columns: 1fr 350px;
    column-gap: 20px;
    align-items: start;
  }
  #product-info-area > *{ grid-column: 1; }
  #product-info-area .installment-sidebar{ grid-column: 2; align-self: start; }
}
@media (min-width: 1200px) and (max-width: 1399.98px){
  #product-info-area{
    display: grid;
    grid-template-columns: 1fr 320px;
    column-gap: 18px;
    align-items: start;
  }
  #product-info-area > *{ grid-column: 1; }
  #product-info-area .installment-sidebar{ grid-column: 2; align-self: start; }
}
@media (min-width: 992px) and (max-width: 1199.98px){
  #product-info-area{
    display: grid;
    grid-template-columns: 1fr 280px;
    column-gap: 16px;
    align-items: start;
  }
  #product-info-area > *{ grid-column: 1; }
  #product-info-area .installment-sidebar{ grid-column: 2; align-self: start; }
}

/* Main Image Container */
.main-image-container {
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.main-image-container img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
}

/* Thumbnail Gallery */
.product-thumbnails {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.thumbnail-wrapper {
    width: 80px;
    height: 80px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnail-wrapper:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.25);
}

.thumbnail-wrapper.active {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.thumbnail-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Product Info Styling */
.product-info-section h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.3;
}

.product-info-section .price {
    font-size: 2rem;
    font-weight: 700;
    color: #dc3545;
    margin-bottom: 20px;
}

.product-info-section .description {
    font-size: 1rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 25px;
    max-height: 300px;
    overflow-y: auto;
}

/* Quantity และ Add to Cart */
.quantity-cart-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.quantity-controls button {
    width: 40px;
    height: 40px;
    border: none;
    background: #f8f9fa;
    color: #333;
    cursor: pointer;
    transition: background-color 0.2s;
}

.quantity-controls button:hover {
    background: #e9ecef;
}

.quantity-controls input {
    width: 60px;
    height: 40px;
    text-align: center;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    outline: none;
}

.add-to-cart-btn {
  flex: 1 1 auto;
  min-height: 36px; /* ~-25-30% */
  background: linear-gradient(45deg, #28a745, #20c997);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.9rem; /* tighter */
  white-space: nowrap; /* avoid wrapping "เพิ่มลงตะกร้า" */
}

.add-to-cart-btn:hover {
    background: linear-gradient(45deg, #218838, #1aa085);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40,167,69,0.3);
}

/* Product detail CTA row: prevent buttons from being squeezed */
.quantity-cart-section .actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr; /* two columns */
  gap: 12px;
  width: 100%;
  min-width: 0; /* allow content to shrink without overflowing */
  grid-auto-rows: minmax(36px, auto);
}

/* First button spans full width (first row) */
.quantity-cart-section .actions-row #add-to-cart-btn{
  grid-column: 1 / -1;
}

.quantity-cart-section .actions-row > * {
  min-width: 0; /* avoid overflow of long labels */
}

#buy-now-btn,
#add-to-wishlist-btn {
  min-height: 36px; /* match add-to-cart */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.5rem 0.9rem;
  white-space: nowrap;
}

/* Harmonize button text sizing inside the actions row */
.quantity-cart-section .actions-row .btn,
.quantity-cart-section .actions-row button {
  font-size: 0.9rem; /* smaller text so it fits in one line */
  line-height: 1.15;
  letter-spacing: 0.2px;
}

.quantity-cart-section .actions-row i{
  font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 992px) {
  .product-detail-row {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 20px;
  }
  .main-image-container {
    height: 350px;
  }
  .thumbnail-wrapper {
    width: 70px;
    height: 70px;
  }
}

@media (max-width: 768px) {
  .product-detail-container {
    width: 100% !important;
    padding: 15px;
  }

    .main-image-container {
        height: 300px;
    }

    .thumbnail-wrapper {
        width: 60px;
        height: 60px;
    }

    .product-info-section h1 {
        font-size: 1.5rem;
    }

    .product-info-section .price {
        font-size: 1.7rem;
    }

  .quantity-cart-section {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .quantity-cart-section .actions-row {
    grid-template-columns: 1fr; /* stack all on small screens */
  }
}

@media (max-width: 576px) {
    .main-content-wrapper {
        padding: 10px;
    }

    .product-detail-container {
        padding: 10px;
    }

    .main-image-container {
        height: 250px;
    }

    .thumbnail-wrapper {
        width: 50px;
        height: 50px;
    }

    .product-thumbnails {
        gap: 8px;
    }
}

/* ===== ADD TO CART BUTTON THEME ===== */
/* ปรับสีปุ่มเพิ่มลงตะกร้าให้เป็น gradient ชมพู-ฟ้าตาม theme ของเว็บไซต์ */

/* Button styles for add to cart buttons */
.btn-primary,
.add-to-cart-btn,
.add-to-cart,
button.btn-primary {
    background: linear-gradient(135deg, #ff6b9d 0%, #4fc3f7 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    padding: 0.6rem 1.2rem !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3) !important;
    position: relative !important;
    overflow: hidden !important;
}

/* === Brand overrides for Installments panel (closer than :root, override JS defaults) === */
body{
  --it-border: #E4E6ED;           /* เส้นขอบการ์ด/พาเนล */
  --it-divider: #EAEFF5;          /* เส้นคั่นหัวข้อ/ตาราง */
  --it-card-bg: #FFFFFF;          /* พื้นการ์ด */
  --it-title: #102A43;            /* สีหัวข้อเข้ม */
  --it-text: #334E68;             /* ตัวหนังสือหลัก */
  --it-muted: #829AB1;            /* ตัวหนังสือรอง */
  --it-monthly: #FF8A00;          /* สีราคาเริ่มต้น/เดือน */
  --it-cta-start: #2F80ED;        /* ปุ่ม CTA ไล่เฉด เริ่ม */
  --it-cta-end: #1C67C6;          /* ปุ่ม CTA ไล่เฉด จบ */
  --it-table-head-bg: #F5F8FC;    /* พื้นหัวตาราง */
  --it-table-border: #E7ECF3;     /* เส้นขอบตาราง */
  --it-logo-border: #E3E8EE;      /* กรอบโลโก้ธนาคาร */
  --it-highlight: #E9FBF0;        /* แถวไฮไลต์ Best */
}

.btn-primary:hover,
.add-to-cart-btn:hover,
.add-to-cart:hover,
button.btn-primary:hover {
    background: linear-gradient(135deg, #e55a8a 0%, #3aa8e0 100%) !important;
    transform: translateY(-2px) scale(1.05) !important;
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4) !important;
}

.btn-primary:active,
.add-to-cart-btn:active,
.add-to-cart:active,
button.btn-primary:active {
    background: linear-gradient(135deg, #d14977 0%, #2e94cc 100%) !important;
    transform: translateY(-1px) scale(1.02) !important;
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.5) !important;
}

/* เอฟเฟกต์แสงระยิบระยับ */
.btn-primary::before,
.add-to-cart-btn::before,
.add-to-cart::before,
button.btn-primary::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent) !important;
    transition: left 0.6s ease !important;
}

.btn-primary:hover::before,
.add-to-cart-btn:hover::before,
.add-to-cart:hover::before,
button.btn-primary:hover::before {
    left: 100% !important;
}

/* สำหรับปุ่มขนาดเล็ก */
.btn-primary.btn-sm,
.add-to-cart-btn.btn-sm,
.add-to-cart.btn-sm {
    padding: 0.4rem 0.8rem !important;
    font-size: 0.875rem !important;
    border-radius: 6px !important;
}

/* สำหรับปุ่มขนาดใหญ่ */
.btn-primary.btn-lg,
.add-to-cart-btn.btn-lg,
.add-to-cart.btn-lg {
    padding: 0.8rem 1.6rem !important;
    font-size: 1.125rem !important;
    border-radius: 10px !important;
}

/* สำหรับปุ่มที่ disabled */
.btn-primary:disabled,
.add-to-cart-btn:disabled,
.add-to-cart:disabled,
button.btn-primary:disabled {
    background: linear-gradient(135deg, #cccccc 0%, #999999 100%) !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.6 !important;
}

.btn-primary:disabled:hover,
.add-to-cart-btn:disabled:hover,
.add-to-cart:disabled:hover,
button.btn-primary:disabled:hover {
    background: linear-gradient(135deg, #cccccc 0%, #999999 100%) !important;
    transform: none !important;
    box-shadow: none !important;
}

/* ===== UNIVERSAL SECTION MARGIN & PADDING RESET ===== */
/* ให้ทุก section มีขอบระยะซ้าย-ขวาเท่ากันอย่างสมบูรณ์ */

/* รีเซ็ต margin และ padding ทุก section ให้เท่ากัน */
.flash-sell-header,
.section-header-flash-sell,
[class*="flash-sell"],
.flash-sale-section,
.vendor-support-section,
.logo-strip-section,
.product-grid-section,
.product-carousel-section,
.banner-grid-section,
.advertisement-banner-section,
.blog-section,
.content-section,
.section-wrapper,
.hero-section,
.category-section,
.main-content-wrapper,
section[class*="section"],
div[class*="section"] {
    width: 100% !important;
    max-width: none !important;
  /* Removed forced transparent background to allow section-specific backgrounds (e.g., header images) */
    padding: 0 !important; /* รีเซ็ต padding ทั้งหมด */
    margin: 0 !important; /* รีเซ็ต margin ทั้งหมด */
    box-sizing: border-box !important;
  overflow: hidden !important;
    position: relative !important;
}

/* ===== UNIVERSAL CONTAINER STYLING ===== */
/* ให้ทุก container มีขอบระยะซ้าย-ขวาเท่ากันสมบูรณ์ */

.flash-sell-header .container,
.section-header-flash-sell .container,
[class*="flash-sell"] .container,
.flash-sale-section .container,
.vendor-support-section .container,
.vendor-support-section .vendor-support-container,
.logo-strip-section .container,
.product-grid-section .container,
.product-carousel-section .container,
.banner-grid-section .container,
.advertisement-banner-section .container,
.blog-section .container,
.content-section .container,
.section-wrapper .container,
.hero-section .container,
.category-section .container,
.main-content-wrapper .container,
section[class*="section"] .container,
div[class*="section"] .container {
    max-width: 1400px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 30px 60px !important; /* ขอบซ้าย-ขวาเท่ากันทุก section */
    box-sizing: border-box !important;
}

/* Flash Sale sections: allow header/artwork overflow and backgrounds */
.section-header-flash-sell,
.flash-sale-section,
[class*="flash-sell"] {
  overflow: visible !important;
}

.flash-sell-header h2,
.section-header-flash-sell h2,
[class*="flash-sell"] h2,
.flash-sale-section h2 {
    color: #333 !important;
    font-size: 32px !important;
    font-weight: 700 !important;
    margin: 0 0 30px 0 !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    text-align: center !important;
    background: linear-gradient(135deg, #ff6b9d 0%, #4fc3f7 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    position: relative !important;
    padding: 15px 0 !important;
}

.flash-sell-header h2::after,
.section-header-flash-sell h2::after,
[class*="flash-sell"] h2::after,
.flash-sale-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #ff6b9d 0%, #4fc3f7 100%);
    border-radius: 2px;
}

/* Flash-sale card image frame fix: make image frame full-width and keep full image visible */
.section-header-flash-sell .card-img-top-wrapper,
.flash-sale-section .card-img-top-wrapper,
[class*="flash-sell"] .card-img-top-wrapper {
  width: 100% !important;
  height: var(--pc-image-height-fixed, 240px) !important; /* Increased from 190px to 240px */
  aspect-ratio: auto !important; /* cancel any square/aspect overrides */
  padding: 8px !important; /* Increased from 6px to 8px for more space */
  background: #fff !important; /* consistent white canvas behind product */
  overflow: hidden; /* avoid odd overflow while disabling zoom below */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: none !important; /* Remove any shadow that might crop the image */
  border: none !important; /* Remove any border that might crop the image */
}

.section-header-flash-sell .card-img-top,
.flash-sale-section .card-img-top,
[class*="flash-sell"] .card-img-top {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  margin: 0 auto !important;
  transform: none !important; /* Prevent any transforms that might cause cropping */
  border-radius: 0 !important; /* Remove border-radius that could crop corners */
  box-sizing: border-box !important;
}

/* Disable hover-zoom inside flash-sale to prevent any perceived cropping */
.section-header-flash-sell .card:hover .card-img-top,
.flash-sale-section .card:hover .card-img-top,
[class*="flash-sell"] .card:hover .card-img-top {
  transform: none !important;
  filter: none !important;
}

/* Overrule generic Swiper slide image rules for product cards in flash-sale */
.flash-sale-section .swiper-slide img.card-img-top,
[class*="flash-sell"] .swiper-slide img.card-img-top,
.section-header-flash-sell .swiper-slide img.card-img-top {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  transform: none !important;
  transition: none !important;
  border-radius: 0 !important;
}

/* ===== UNIVERSAL SECTION CONSISTENCY ===== */
/* ให้ทุก section มีขอบเท่ากันและดูมืออาชีพ */

.product-grid-section,
.product-carousel-section,
.banner-grid-section,
.advertisement-banner-section,
.blog-section,
.content-section,
.section-wrapper {
    width: 100% !important;
    background: transparent !important;
    padding: 30px 0 !important;
    margin: 20px 0 !important;
    overflow: hidden !important;
    position: relative !important;
}

.product-grid-section .container,
.product-carousel-section .container,
.banner-grid-section .container,
.advertisement-banner-section .container,
.blog-section .container,
.content-section .container,
.section-wrapper .container {
    max-width: 1400px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 30px 60px !important; /* ขอบซ้าย-ขวาเท่ากันทุก section */
    box-sizing: border-box !important;
}

/* ===== SECTION TITLES UNIVERSAL STYLING ===== */
.product-grid-section h2,
.product-carousel-section h2,
.banner-grid-section h2,
.advertisement-banner-section h2,
.blog-section h2,
.content-section h2,
.section-wrapper h2,
.section-header h2 {
    color: #333 !important;
    font-size: 32px !important;
    font-weight: 700 !important;
    margin: 0 0 30px 0 !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    text-align: center !important;
    background: linear-gradient(135deg, #ff6b9d 0%, #4fc3f7 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    position: relative !important;
    padding: 15px 0 !important;
}

.product-grid-section h2::after,
.product-carousel-section h2::after,
.banner-grid-section h2::after,
.advertisement-banner-section h2::after,
.blog-section h2::after,
.content-section h2::after,
.section-wrapper h2::after,
.section-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #ff6b9d 0%, #4fc3f7 100%);
    border-radius: 2px;
}

/* ===== RESPONSIVE SECTION CONSISTENCY ===== */

/* Desktop Large (>1400px) */
@media (min-width: 1401px) {
    .flash-sell-header .container,
    .section-header-flash-sell .container,
    [class*="flash-sell"] .container,
    .flash-sale-section .container,
    .product-grid-section .container,
    .product-carousel-section .container,
    .banner-grid-section .container,
    .advertisement-banner-section .container,
    .blog-section .container,
    .content-section .container,
    .section-wrapper .container {
        padding: 40px 80px !important; /* เพิ่ม padding สำหรับหน้าจอใหญ่ */
    }
}

/* Desktop Medium (1200px - 1400px) */
@media (max-width: 1400px) and (min-width: 1201px) {
    .flash-sell-header .container,
    .section-header-flash-sell .container,
    [class*="flash-sell"] .container,
    .flash-sale-section .container,
    .product-grid-section .container,
    .product-carousel-section .container,
    .banner-grid-section .container,
    .advertisement-banner-section .container,
    .blog-section .container,
    .content-section .container,
    .section-wrapper .container {
        padding: 35px 70px !important;
    }
}

/* Tablet (768px - 1200px) */
@media (max-width: 1200px) and (min-width: 769px) {
    .flash-sell-header .container,
    .section-header-flash-sell .container,
    [class*="flash-sell"] .container,
    .flash-sale-section .container,
    .product-grid-section .container,
    .product-carousel-section .container,
    .banner-grid-section .container,
    .advertisement-banner-section .container,
    .blog-section .container,
    .content-section .container,
    .section-wrapper .container {
        padding: 30px 50px !important;
    }
}

/* Mobile Large (481px - 768px) */
@media (max-width: 768px) and (min-width: 481px) {
    .flash-sell-header .container,
    .section-header-flash-sell .container,
    [class*="flash-sell"] .container,
    .flash-sale-section .container,
    .product-grid-section .container,
    .product-carousel-section .container,
    .banner-grid-section .container,
    .advertisement-banner-section .container,
    .blog-section .container,
    .content-section .container,
    .section-wrapper .container {
        padding: 25px 30px !important;
    }

    .flash-sell-header h2,
    .section-header-flash-sell h2,
    [class*="flash-sell"] h2,
    .flash-sale-section h2,
    .product-grid-section h2,
    .product-carousel-section h2,
    .banner-grid-section h2,
    .advertisement-banner-section h2,
    .blog-section h2,
    .content-section h2,
    .section-wrapper h2,
    .section-header h2 {
        font-size: 24px !important;
        letter-spacing: 1px !important;
    }
}

/* Mobile Small (≤480px) */
@media (max-width: 480px) {
    .flash-sell-header .container,
    .section-header-flash-sell .container,
    [class*="flash-sell"] .container,
    .flash-sale-section .container,
    .product-grid-section .container,
    .product-carousel-section .container,
    .banner-grid-section .container,
    .advertisement-banner-section .container,
    .blog-section .container,
    .content-section .container,
    .section-wrapper .container {
        padding: 20px 20px !important; /* ขอบเท่ากันแม้บน mobile */
    }

  /* Removed empty flash sale h2 ruleset to satisfy linter */
}

/* ===== TEXT TRUNCATOR SYSTEM ===== */
/* การย่อเนื้อหาข้อความแบบสวยงาม */

.truncated-content-wrapper {
    position: relative;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    line-height: 1.6;
}

/* Utility: 3-line clamp for product summaries */
.product-card-wrapper .product-desc,
.product-card-wrapper .product-description,
.product-card .product-desc,
.product-card .product-description,
.product-desc.clamp-3,
.product-description.clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  max-height: 44.55px;
  overflow: hidden;
}

/* On grid cards keep description at 3 lines (consistent) */
.product-grid .product-card-wrapper .product-desc,
.product-grid .product-card-wrapper .product-description {
  -webkit-line-clamp: 3;
  line-clamp: 3;
  max-height: 44.55px;
  /* font-size controlled by enhanced-product-cards.css */
}

.truncated-content-wrapper.collapsed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48px; /* fade height */
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0.95));
}

.truncated-content-wrapper p,
.truncated-content-wrapper div {
    margin-bottom: 12px;
}

.truncated-content-wrapper p:last-child,
.truncated-content-wrapper div:last-child {
    margin-bottom: 0;
}

/* ปุ่มแสดง/ซ่อนรายละเอียด */
.text-truncator-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #0066cc;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    padding: 8px 0;
    margin-top: 12px;
    transition: all 0.2s ease;
}

.text-truncator-toggle:hover {
    color: #004499;
    text-decoration: none;
    transform: translateX(2px);
}

.text-truncator-toggle:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
    border-radius: 4px;
}

.text-truncator-toggle i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.text-truncator-toggle:hover i {
    transform: scale(1.1);
}

/* สำหรับ product description และ specifications */
#product-description .truncated-content-wrapper,
#product-specifications .truncated-content-wrapper {
    font-size: 15px;
    color: #444;
}

#product-description .text-truncator-toggle,
#product-specifications .text-truncator-toggle {
    border-top: 1px solid #e9ecef;
    padding-top: 12px;
    width: 100%;
    text-align: left;
    justify-content: flex-start;
}

.truncated-clickable { cursor: pointer; }
.truncated-clickable:focus { outline: 2px solid #80bdff; outline-offset: 2px; border-radius: 6px; }

/* ===== Short Description (right side of images) ===== */
.description-section #product-short-description {
  color: #144782; /* ฟ้าเข้ม */
}
.description-section #product-short-description * {
  color: inherit;
}

/* ===== Bottom Tab: รายละเอียดสินค้า ===== */
#product-description {
  color: #144782; /* ฟ้าเข้ม */
}
#product-description * {
  color: inherit;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .text-truncator-toggle {
        font-size: 13px;
        padding: 6px 0;
        margin-top: 10px;
    }
}

@media (max-width: 576px) {
    .truncated-content-wrapper {
        font-size: 14px;
    }

    .text-truncator-toggle {
        font-size: 12px;
    }
}
