/* ========================================
   Global Styles & Reset
======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Variables */
    --primary-purple: #7D66FF;
    --primary-purple-light: #D7D6F8;
    --primary-yellow: #E4FF4B;
    --primary-pink: #ec4899;
    --primary-pink-light: #f472b6;
    --white: #ffffff;
    --black: #000000;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #73726E;
    --gray-600: #666666;
    --gray-800: #333333;
}

body {
    font-family: 'Noto Sans Thai', sans-serif;
    background-color: var(--gray-100);
    overflow-x: hidden;
    position: relative;
}

[v-cloak] {
  display: none;
}

/* SweetAlert2 Custom Button Style */
.swal2-confirm {
    background-color: #E4FF4B !important;
    color: #000000 !important;
    border-radius: 999px !important;
    font-weight: 600 !important;
    border: none !important;
}

.swal2-confirm:hover {
    background-color: #d4ef3b !important;
}

.swal2-cancel {
    border-radius: 999px !important;
}

/* ========================================
   Header Styles
======================================== */

.header {
    background: var(--primary-purple);
    padding: 0.75rem 1.25rem;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.status-bar {
    color: var(--white);
    font-size: 0.9375rem;
    font-weight: 600;
}

.header-logo {
    height: 2.5rem;
    width: auto;
}

.header-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: transform 0.2s ease;
}

.btn-icon:hover {
    transform: scale(1.1);
}

/* ========================================
   Sidebar Styles
======================================== */

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1998;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: var(--white);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    z-index: 1999;
    overflow-y: auto;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    background: var(--primary-purple);
    position: relative;
}

.user-profile-link {
    text-decoration: none;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--white);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    flex: 1;
}

.user-name {
    color: var(--white);
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.user-date {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    margin: 0;
}

.btn-close-sidebar {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-item {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--gray-800);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-item:hover {
    background: var(--gray-100);
}

.sidebar-item:last-child {
    border-bottom: none;
}

.sidebar-item span {
  display: flex;
  align-items: center;
  gap: 1rem;
}


/* ========================================
   Search Section
======================================== */

.search-section {
    padding: 1rem 1.25rem;
    background: var(--white);
}

.search-wrapper {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    background: var(--gray-100);
    border-radius: 0.5rem;
    overflow: hidden;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.75rem 1rem;
    /* font-size: 0.875rem; */
    font-size: 0.9375rem;
    color: var(--gray-800);
    outline: none;
}

.search-input::placeholder {
    color: var(--gray-600);
}

.search-btn {
    background: transparent;
    border: none;
    padding: 0.75rem 1rem;
    color: var(--gray-600);
    cursor: pointer;
    font-size: 1.25rem;
}

/* ========================================
   Banner Section
======================================== */

.banner-section {
  position: relative;
  /* background: var(--primary-pink); */
  padding: 0;
  overflow: hidden;
}

.banner-section .carousel-item {
  aspect-ratio: 16 / 9;
}

.banner-section img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.carousel-indicators [data-bs-target] {
  background-color: rgba(255, 255, 255, 0.6);
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
}

.carousel-indicators .active {
  background-color: white;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  filter: invert(1);
  width: 1.8rem;
  height: 1.8rem;
  /* background-color: white; */
}

.carousel-control-prev,
.carousel-control-next {
  width: 15%;
  opacity: 0.8;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  opacity: 1;
}

/* ========================================
    Statistics Section
======================================== */

.statistics-section {
    background: white;
    padding: 0.5rem 0.5rem;
    margin-bottom: 1rem;
    border-radius: 1rem;
    box-shadow: var(--gray-300) 0px 4px 5px;
}

.index-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.index-stat-card {
    text-align: center;
    padding: 0.75rem;
}

.index-stat-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.index-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-purple);
}

.index-stat-unit {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-left: 0.25rem;
}


/* ========================================
   Content Sections
======================================== */

.content-section {
    padding: 1.25rem;
    background: var(--white);
    /* margin-top: 0.625rem; */
}

.section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 1rem;
}

/* ========================================
   Store Cards
======================================== */

.store-card {
    aspect-ratio: 1;
    border: 1.5px solid var(--gray-200);
    border-radius: 0.5rem;
    display: flex;
    line-height: 1.2;
    cursor: pointer;
    transition: all 0.3s ease;
}

.store-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center; 
    border-radius: 0.3rem;
}

.store-popmart {
    border-color: var(--gray-200);
    color: var(--gray-200);
}

.store-52toys {
    border-color: var(--gray-200);
    color: var(--gray-200);
}

.store-finding {
    border-color: var(--gray-200);
    color: var(--gray-200);
}

.store-tnt {
    border-color: #00BF89;
    color: #00BF89;
}

.store-toyzero {
    border-color: var(--gray-200);
    color: var(--gray-200);
}

.store-toptoy {
    background: #FEE101;
    border-color: #FEE101;
    color: var(--gray-800);
}

.store-heyone {
    background: var(--gray-200);
    border-color: var(--gray-200);
}

.store-toycity {
    background: #0000;
    border-color: #0000;
}

/* ========================================
   Horizontal Scroll (Mobile)
======================================== */

.horizontal-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-right: 1rem;
    scrollbar-width: none;
}

.horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.horizontal-scroll .col-3 {
    flex: 0 0 auto;
    width: 30%;
}

/* ========================================
   Character Cards
======================================== */

.character-card {
    width: 100%;
    cursor: pointer;
    transition: transform 0.3s ease;
    background: var(--white);

    display: flex;
    flex-direction: column;   /* สำคัญ */
    align-items: stretch;
    gap: 0.5rem;

    border: 1.5px solid var(--gray-200);
    border-radius: 0.5rem;
}

.character-img {
    width: 100%;
    aspect-ratio: 1;
    background: var(--gray-100);
    border-radius: 0.3rem;
    overflow: hidden;
}

.character-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center; 
    border-radius: 0.3rem;
}

.character-text {
    width: 100%;
    text-align: center;
    padding: 0.25rem 0;
}

.character-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.character-card:hover .character-img {
    background: var(--gray-100);
}

.horizontal-scroll .col-6 {
    flex: 0 0 auto;
    width: 30%;
}

/* ========================================
   Product Cards
======================================== */

.product-card {
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
}

.product-img {
    aspect-ratio: 3 / 4;
    width: 100%;
    background: var(--gray-100);
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
    transition: background 0.3s ease;
}

.product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center; 
  display: block; 
  border-radius: 0.3rem;
}

.product-card:hover .product-img {
    background: var(--gray-200);
}

.product-name {
  font-size: 0.75rem;
  color: var(--gray-600);
  line-height: 1.4;
  margin: 0;

  display: -webkit-box;
  display: box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;

  height: calc(1.4em * 2);
}

.product-info {
  display: flex;
  gap: 0.3rem; /* ระยะห่างระหว่างไอคอนกับข้อความ */
  font-size: 0.75rem;
  color: var(--gray-600);
}

.product-info i {
  font-size: 1rem;
  color: var(--primary-purple);
}

.product-info p {
  margin: 0;
}

/* ===== Art Toy Status Badge ===== */

.status-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 8px;
    z-index: 2;
    font-weight: 500;
}

/* รอตรวจ */
.badge-wait {
    background: #FCF5DB;
    color: #E99222;
}

/* พร้อมแลก */
.badge-ready {
    background: #E1FAE7;
    color: #3CC55D;
}

/* อยู่ระหว่างแลก */
.badge-progress {
    background: #E5F3FE;
    color: #028DFE;
}

/* แลกสำเร็จ */
.badge-complete {
    background: #F1F1F1;
    color: #787878;
}

/* ข้อมูลไม่ผ่าน */
.badge-reject {
    background: #FDEFEE;
    color: #E96A5C;
}

/* fallback */
.badge-gray {
    background: #F1F1F1;
    color: #787878;
}

/* ========================================
   Fixed Add Button
======================================== */

.btn-add-fixed {
    position: fixed;
    bottom: 1rem;
    right: 1rem;

    background: var(--primary-yellow);
    color: var(--black);

    padding: 1rem 1.75rem;
    border-radius: 1.875rem;

    font-size: 1rem;
    font-weight: 700;

    display: flex;
    align-items: center;
    gap: 0.5rem;

    text-decoration: none;
    z-index: 999;

    /* transition ครอบทุก property รวม width/height/border-radius */
    transition: padding 0.3s ease, width 0.3s ease, height 0.3s ease,
                border-radius 0.3s ease, gap 0.3s ease;
}

.btn-add-fixed:hover {
    transform: translateY(-3px);
    color: var(--black);
}

/* ไอคอน + หนาขึ้น */
.btn-add-fixed i {
    font-size: 1.4rem;
    font-weight: 900;
    -webkit-text-stroke: 0.5px currentColor;
}

/* ข้อความ — transition สมูท */
.btn-add-fixed .btn-text {
    display: inline-block;
    max-width: 10rem;
    overflow: hidden;
    white-space: nowrap;
    opacity: 1;
    transition: max-width 0.3s ease, opacity 0.25s ease;
}

/* === Compact mode (scroll > 100px) === */
.btn-add-fixed.is-compact {
    padding: 0;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    justify-content: center;
    gap: 0;
}

.btn-add-fixed.is-compact .btn-text {
    max-width: 0;
    opacity: 0;
}

/* ========================================
   Footer
======================================== */

.footer {
    background: var(--primary-purple);
    padding: 1.5rem 1.25rem;
    margin-top: 2rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-logo img {
    height: 2rem;
    width: auto;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 150px;
}

.footer-col a {
    color: var(--white);
    text-decoration: none;
    font-size: 0.75rem;
    transition: opacity 0.2s ease;
}

.footer-col a:hover {
    opacity: 0.8;
}

/* Responsive Design*/

@media (max-width: 768px) {
  .carousel-control-prev,
  .carousel-control-next {
    display: none;
  }
}

@media (min-width: 768px) {
    .main-content {
        max-width: 768px;
        margin: 0 auto;
    }
    
    .header-content,
    .search-section,
    .content-section,
    .footer {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    .banner-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .sidebar {
        width: 320px;
        left: -320px;
    }
}

@media (min-width: 1024px) {
    .main-content {
        max-width: 1024px;
    }
    
    .store-card,
    .character-card,
    .product-card {
        cursor: pointer;
    }
    
    .btn-add-fixed {
        bottom: 2rem;
        right: 2rem;
    }
    
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .footer-links {
        flex: 1;
        justify-content: flex-end;
    }
}

@media (min-width: 1440px) {
    .main-content {
        max-width: 1200px;
    }
    
    .banner-title {
        font-size: 2.5rem;
    }
    
    .banner-subtitle {
        font-size: 1.125rem;
    }
}

/* ========================================
   Utility Classes
======================================== */

.text-center {
    text-align: center;
}

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.gap-3 {
    gap: 1.5rem;
}

/* ========================================
   Animation Classes
======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-in-left {
    animation: slideInLeft 0.3s ease;
}

.slide-in-right {
    animation: slideInRight 0.3s ease;
}


/* Add Art Toy */

/* Header*/

.page-header {
    background: var(--white);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-header .container-fluid {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-back {
    background: transparent;
    border: none;
    color: var(--gray-600);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: color 0.2s ease;
}

.btn-back:hover {
    color: var(--gray-800);
}

.page-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
    flex: 1;
    text-align: center;
}

/* Form Section*/

.form-section {
    padding: 1.5rem 1.25rem;
    background: var(--white);
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.form-label.required::after {
    content: '*';
    color: #ef4444;
    margin-left: 0.25rem;
}

/* Upload Area*/

.upload-area {
    width: 100%;
    min-height: 120px;
    border: 2px dashed var(--gray-300);
    border-radius: 0.5rem;
    padding: 12px;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.upload-area:hover {
    border-color: var(--primary-purple);
    background: rgba(124, 58, 237, 0.02);
}

.preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.preview-item {
    position: relative;
    width: 64px;
    height: 64px;
    border: 1px dashed #ccc;
    border-radius: 6px;
    overflow: hidden;
    background: #f8f8f8;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 14px;
    line-height: 18px;
    cursor: pointer;
}

.form-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray-600);
    line-height: 1.4;
}

/* Form Controls*/

.form-control,
.form-select {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.875rem;
    color: var(--gray-800);
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.form-control::placeholder {
    color: var(--gray-600);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.form-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23666' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    appearance: none;
}

.char-count {
    position: absolute;
    bottom: -1.25rem;
    right: 0;
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* Checkbox Group*/

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--gray-300);
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-check-input:checked {
    background-color: var(--primary-purple);
    border-color: var(--primary-purple);
}

.form-check-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.form-check-label {
    font-size: 0.875rem;
    color: var(--gray-800);
    cursor: pointer;
    user-select: none;
}

/* Form Note*/

.form-note {
    padding: 1rem;
    background: var(--gray-100);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.form-note small {
    font-size: 0.75rem;
    color: var(--gray-600);
    line-height: 1.5;
}

/* Submit Button*/

.btn-submit {
    width: 100%;
    background: var(--primary-yellow);
    color: var(--black);
    border: none;
    padding: 1rem;
    border-radius: 20rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.btn-submit:hover {
    transform: translateY(-5px);
    background: var(--primary-yellow);
}

.btn-submit-second {
    width: 100%;
    color: var(--primary-purple);
    border: 3px solid var(--primary-purple);
    /* border: none; */
    padding: 1rem;
    border-radius: 20rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.btn-submit:disabled,
.btn-submit.disabled {
    background-color: var(--gray-200);
    color: #ffffff;
    opacity: 1; 
    cursor: not-allowed;
}

/* --- Modal --- */
.toy-modal-content {
  border: none;
  border-radius: 0;
  overflow-y: auto;
  background: #fff;
  max-height: 100vh;
}

.custom-close {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  background-color: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  opacity: 1;
}

.main-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.carousel-indicators [data-bs-target] {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
}
.carousel-indicators .active {
  background-color: white;
}

.thumbnail-row {
  display: flex;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.thumbnail-row::-webkit-scrollbar {
  display: none;
}
.thumbnail-item {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
}
.thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumbnail-item.active {
  border-color: var(--bs-primary);
}

.toy-modal-body {
  padding: 1.25rem;
  font-size: 0.95rem;
  color: #333;
}

.toy-title {
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.toy-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.info-row .label {
  font-weight: 500;
  color: var(--gray-400);
}
.info-row .value {
  text-align: right;
  color: #222;
  font-weight: 600;
}

.toy-desc {
  margin-top: 1rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.thumbnail-item.active {
  border-color: var(--primary-purple);
}

.modal-owner-avatar{
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid #f0f0f0;
}

.modal-owner-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Responsive */
@media (min-width: 768px) {
  .modal-fullscreen-sm-down {
    max-width: 600px;
    margin: auto;
    border-radius: 1rem;
  }
}

/* ========================================
   Art Toy Modal Fix Scroll Group
======================================== */

/* ทำให้ modal-body ไม่ scroll แยก */
.toy-modal-content .modal-body {
    overflow: visible !important;
    /* padding-bottom: 6rem;  */
    /* เผื่อพื้นที่ปุ่ม fixed ด้านล่าง */
}

/* ทำให้ modal-content เป็นตัว scroll หลัก */

.toy-modal-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    border-radius: 1rem;
    overflow: hidden;
}

.toy-scroll-area {
    overflow-y: auto;
    flex: 1;
}

/* ปรับ carousel ให้ไม่ fix ความสูง */
#toyCarousel .carousel-inner {
    height: auto;
}

.main-image {
    object-fit: contain;
    max-height: 60vh;
}

/* thumbnail ไม่ scroll แยก */
.thumbnail-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    overflow-y: hidden;
}

/* ========================================
   Art Toy Modal Action Bar
======================================== */

.toy-action-bar {
    position: sticky;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    background: white;
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
    z-index: 5;
}

/* ปุ่ม */
.toy-action-bar .btn-submit {
    background: var(--primary-yellow);
    color: black;
    font-weight: 600;
    border-radius: 20rem;
    padding: 0.75rem;
}

.toy-action-bar .btn-submit:hover {
    opacity: 0.9;
}

/* Button */

.toy-button {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}

.btn-edit-button,
.btn-delete-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.75rem;
  border-radius: 1.875rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
}

.btn-edit-button{
    color: var(--primary-purple);
    border: 3px solid var(--primary-purple);
}

.btn-edit-button:hover{
    color: var(--primary-purple);
    border: 3px solid var(--primary-purple);
}

/* Edit Art Toy Page */
.is-invalid {
  border: 1.5px solid #dc3545 !important; /* สีแดง Bootstrap */
  background-color: #fff5f5;
}

.invalid-feedback {
  color: #dc3545;
  font-size: 0.85rem;
  margin-top: 4px;
}

.checkbox-group.is-invalid {
  border: 1.5px solid #dc3545 !important;
  background-color: #fff5f5;
}

/* ========================================
   Owner Profile Card
======================================== */

.owner-profile-card {
  background: #fff;
  padding: 1rem;
  margin: 1.5rem 0;
}

.owner-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.owner-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid #f0f0f0;
}

.owner-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.owner-info {
  flex: 1;
}

.owner-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #222;
  margin: 0 0 0.25rem 0;
}

.owner-location {
  font-size: 0.75rem;
  color: #666;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.owner-location i {
  font-size: 0.75rem;
  color: #666;
}

.btn-follow {
  background: var(--primary-purple, #7c3aed);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-follow i {
  font-size: 0.875rem;
}

/* Owner Stats */
.owner-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid #e5e5e5;
}

.stat-item {
  flex: 1;
  text-align: center;
}

.stat-label {
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.stat-value {
  font-size: 0.875rem;
  color: #222;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.stat-value i {
  color: #fbbf24;
  font-size: 0.875rem;
}

.stat-divider {
  width: 1px;
  height: 2rem;
  background: #e5e5e5;
}

.btn-profile-small {
    background: var(--primary-purple, #7c3aed);
    color: white;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 576px) {
  .owner-header {
    flex-wrap: wrap;
  }
  
  .btn-follow {
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
  }
  
  .stat-item {
    font-size: 0.875rem;
  }
  
  .stat-label {
    font-size: 0.6875rem;
  }
  
  .stat-value {
    font-size: 0.8125rem;
  }
}

/* ========================================
   Search Page Styles
======================================== */

/* ========================================
   Filter Sidebar
======================================== */
.text-purple {
  color: #7D66FF !important;
}

.text-purple:hover {
  color: #5c4bcc !important;
  text-decoration: underline;
}

.offcanvas-header {
  padding: 0.75rem 1rem;
}

.offcanvas-title {
  text-align: center;
  flex: 1;
}

/* ===== Filter Chips ===== */
.filter-chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* ทำให้ chip ตัวสุดท้ายโผล่แวบๆ */
    padding-right: 2rem;
    /* ป้องกัน clip */
    padding-bottom: 4px;
    margin-bottom: 0;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.chip {
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    border: 1.5px solid var(--primary-purple, #7c3aed);
    background: #fff;
    color: var(--primary-purple, #7c3aed);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.chip.active {
    background: var(--primary-purple, #7c3aed);
    color: #fff;
}


/* ========================================
   Search Header
======================================== */

.search-header-section {
    padding: 1rem 1.25rem;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
}

.search-bar-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-back {
    background: transparent;
    border: none;
    color: var(--gray-700);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
}

.search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--gray-100);
    border-radius: 0.5rem;
    padding: 0 1rem;
}

.btn-search-submit {
    background: transparent;
    border: none;
    color: var(--gray-600);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
}

/* ========================================
   Results Header
======================================== */

.results-header {
    padding: 0.5rem 1.25rem;
    background: var(--white);
}

.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.results-header .results-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    line-height: 1.5;
}

/* ========================================
   filter-button-section
======================================== */

.filter-button-section .form-check-label {
  font-size: 0.95rem;
}

.filter-button-section {
    padding: 1rem 1.25rem;
    background: var(--white);
}

.btn-filter {
    background: transparent;
    border: 1.5px solid var(--primary-purple);
    color: var(--primary-purple);
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-filter:hover {
    background: var(--primary-purple);
    color: var(--white);
}

/* ========================================
   Pagination
======================================== */

.pagination-section {
    padding: 1.5rem 1.25rem;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
}

.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.btn-page-nav {
    background: var(--white);
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.125rem;
}

.btn-page-nav:hover:not(:disabled) {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.btn-page-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.9375rem;
    color: var(--gray-700);
    font-weight: 500;
}

/* ========================================
   Responsive Design
======================================== */

/* Tablet */
@media (min-width: 768px) {
    .products-section {
        padding: 2rem;
    }
    
    .product-name {
        font-size: 0.9375rem;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .main-content {
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .products-section {
        padding: 2.5rem;
    }
}

/* Mobile Adjustments */
@media (max-width: 576px) {
    .filter-sidebar {
        width: 280px;
        left: -280px;
    }
    
    .results-title {
        font-size: 1rem;
    }
    
    .btn-filter {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }
    
    .product-info {
        padding: 0.625rem;
    }
    
    .product-name {
        font-size: 0.8125rem;
    }
}

/* หมด search*/


/*  Responsive Design*/
/* Tablet (768px and up) */
@media (min-width: 768px) {
    .page-header,
    .form-section {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .upload-area {
        min-height: 150px;
    }
}

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
    .form-section {
        max-width: 800px;
        margin: 0 auto;
    }
    
    .btn-submit {
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ========================================
   Select Art Toy Page
======================================== */

.search-select-arttoy-section {
    width: 100%;
    margin-bottom: 1rem;
    background: var(--white);
}

.search-select-arttoy-section .container-fluid {
    padding: 0 0;
}

.selected-card {
    border: 3px solid #7047EB !important;
    border-radius: 0.3rem;
}

/* ========================================
   Page Title Section ตอนยืนยันการแลก
======================================== */

.page-title-section {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900, #1a1a1a);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 0.9375rem;
    color: var(--gray-600, #666666);
    margin: 0;
}

.wavy-circle {
    --s: 3.5rem; /* adjust to control the size */

    width: var(--s); 
    background-color: var(--primary-purple);
    aspect-ratio: 1;
    --g:/calc(var(--s)*0.153) calc(var(--s)*0.153) radial-gradient(50% 50%,#000 99%,#0000 101%) no-repeat;
    mask: calc(50% + var(--s)*0.4) calc(50% + var(--s)*0) var(--g),calc(50% + var(--s)*0.324) calc(50% + var(--s)*0.235) var(--g),calc(50% + var(--s)*0.124) calc(50% + var(--s)*0.38) var(--g),calc(50% + var(--s)*-0.124) calc(50% + var(--s)*0.38) var(--g),calc(50% + var(--s)*-0.324) calc(50% + var(--s)*0.235) var(--g),calc(50% + var(--s)*-0.4) calc(50% + var(--s)*0) var(--g),calc(50% + var(--s)*-0.324) calc(50% + var(--s)*-0.235) var(--g),calc(50% + var(--s)*-0.124) calc(50% + var(--s)*-0.38) var(--g),calc(50% + var(--s)*0.124) calc(50% + var(--s)*-0.38) var(--g),calc(50% + var(--s)*0.324) calc(50% + var(--s)*-0.235) var(--g),radial-gradient(calc(var(--s)*0.43),#000 99%,#0000 101%) subtract,calc(50% + var(--s)*0.447) calc(50% + var(--s)*0.145) var(--g),calc(50% + var(--s)*0.276) calc(50% + var(--s)*0.381) var(--g),calc(50% + var(--s)*0) calc(50% + var(--s)*0.47) var(--g),calc(50% + var(--s)*-0.276) calc(50% + var(--s)*0.381) var(--g),calc(50% + var(--s)*-0.447) calc(50% + var(--s)*0.145) var(--g),calc(50% + var(--s)*-0.447) calc(50% + var(--s)*-0.145) var(--g),calc(50% + var(--s)*-0.276) calc(50% + var(--s)*-0.381) var(--g),calc(50% + var(--s)*0) calc(50% + var(--s)*-0.47) var(--g),calc(50% + var(--s)*0.276) calc(50% + var(--s)*-0.381) var(--g),calc(50% + var(--s)*0.447) calc(50% + var(--s)*-0.145) var(--g);

    background: #e5e5e5;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

/* ========================================
   Section Card
======================================== */

.exchange-compare {
    position: relative;
}

.section-top {
    padding-bottom: 2.5rem; 
}

.section-bottom {
    padding-top: 2.5rem; 
}

.section-card {
    background: white;
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900, #1a1a1a);
    margin-bottom: 1rem;
}

/* ========================================
   Toy Card
======================================== */

.toy-card {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.toy-image {
    width: 5rem;
    height: 5rem;
    border-radius: 0.5rem;
    object-fit: cover;
    flex-shrink: 0;
}

.toy-info {
    flex: 1;
}

.toy-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900, #1a1a1a);
    margin-bottom: 0.5rem;
}

.toy-owner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.owner-avatar {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    object-fit: cover;
}

.owner-name {
    font-size: 0.875rem;
    color: var(--gray-700, #4a4a4a);
    font-weight: 500;
}

/* ========================================
   Exchange Icon
======================================== */

.exchange-icon-wrapper {
    display: flex;
    justify-content: center;
}

.exchange-icon-wrapper.floating {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.exchange-icon-wavy {
    color: black;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;

    --s: 3.5rem; /* adjust to control the size */

    width: var(--s); 
    background-color: var(--primary-yellow);
    aspect-ratio: 1;
    --g:/calc(var(--s)*0.153) calc(var(--s)*0.153) radial-gradient(50% 50%,#000 99%,#0000 101%) no-repeat;
    mask: calc(50% + var(--s)*0.4) calc(50% + var(--s)*0) var(--g),calc(50% + var(--s)*0.324) calc(50% + var(--s)*0.235) var(--g),calc(50% + var(--s)*0.124) calc(50% + var(--s)*0.38) var(--g),calc(50% + var(--s)*-0.124) calc(50% + var(--s)*0.38) var(--g),calc(50% + var(--s)*-0.324) calc(50% + var(--s)*0.235) var(--g),calc(50% + var(--s)*-0.4) calc(50% + var(--s)*0) var(--g),calc(50% + var(--s)*-0.324) calc(50% + var(--s)*-0.235) var(--g),calc(50% + var(--s)*-0.124) calc(50% + var(--s)*-0.38) var(--g),calc(50% + var(--s)*0.124) calc(50% + var(--s)*-0.38) var(--g),calc(50% + var(--s)*0.324) calc(50% + var(--s)*-0.235) var(--g),radial-gradient(calc(var(--s)*0.43),#000 99%,#0000 101%) subtract,calc(50% + var(--s)*0.447) calc(50% + var(--s)*0.145) var(--g),calc(50% + var(--s)*0.276) calc(50% + var(--s)*0.381) var(--g),calc(50% + var(--s)*0) calc(50% + var(--s)*0.47) var(--g),calc(50% + var(--s)*-0.276) calc(50% + var(--s)*0.381) var(--g),calc(50% + var(--s)*-0.447) calc(50% + var(--s)*0.145) var(--g),calc(50% + var(--s)*-0.447) calc(50% + var(--s)*-0.145) var(--g),calc(50% + var(--s)*-0.276) calc(50% + var(--s)*-0.381) var(--g),calc(50% + var(--s)*0) calc(50% + var(--s)*-0.47) var(--g),calc(50% + var(--s)*0.276) calc(50% + var(--s)*-0.381) var(--g),calc(50% + var(--s)*0.447) calc(50% + var(--s)*-0.145) var(--g);
}