/* =========================================================
   MOBILE PRODUCT DETAIL — MASSUSI STORE
========================================================= */

@media (max-width: 767px) {
  /* =========================
     1. BASE LAYOUT
  ========================= */

  body {
    overflow-x: hidden;
  }

  .product-detail {
    width: 100%;
    margin: 0;
    padding: 0 0 100px;
  }

  .product-breadcrumb {
    display: none;
  }

  .product-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
  }
  .product-detail-page.shop-header {
    display: none;
  }

  /* =========================================================
   2. DETAIL HEADER
========================================================= */

  .detail-header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1100;
    width: 100%;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition:
      background 0.3s ease,
      border-color 0.3s ease,
      backdrop-filter 0.3s ease;
  }

  .detail-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    padding: 8px 14px;
  }

  .detail-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
  }

  .detail-action {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    padding: 0;
    color: #fff;
    background: rgba(0, 0, 0, 0.32);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
  }

  .detail-action i {
    width: 19px;
    height: 19px;
    stroke-width: 2;
  }

  .detail-action span {
    position: absolute;
    top: -4px;
    right: -4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    color: #fff;
    background: #e53935;
    border-radius: 20px;
    font-size: 10px;
  }

  /* Search: tersembunyi saat di atas */

  .detail-search {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    height: 36px;
    padding: 0 11px;
    gap: 8px;
    background: #f2f4f2;
    border-radius: 20px;
    opacity: 0;
    visibility: hidden;
    max-width: 0;
    overflow: hidden;
    transition:
      opacity 0.3s ease,
      max-width 0.3s ease,
      visibility 0.3s ease;
  }

  .detail-search i {
    width: 17px;
    height: 17px;
    color: #68756d;
    flex-shrink: 0;
  }

  .detail-search input {
    width: 100%;
    min-width: 0;
    padding: 0;
    color: #26332b;
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 12px;
  }

  /* Header setelah scroll */

  .detail-header.scrolled {
    background: rgba(255, 255, 255, 0.96);
    border-bottom-color: #e8ece9;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .detail-header.scrolled .detail-action {
    color: #26332b;
    background: #f0f3f0;
  }

  .detail-header.scrolled .detail-search {
    max-width: 100%;
    opacity: 1;
    visibility: visible;
  }

  /* Mobile */

  @media (max-width: 768px) {
    .detail-header {
      display: block;
    }
  }

  /* Desktop: header detail tidak ditampilkan dahulu */

  @media (min-width: 769px) {
    .detail-header {
      display: none;
    }
  }

  /* =========================
   3. PRODUCT GALLERY
========================= */

  .product-gallery {
    position: relative;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    width: 100vw;
    margin: 0 0 0 calc(50% - 50vw);
    padding: 0;
    overflow: hidden;
    background: #f7f9f7;
    border: 0;
    border-radius: 0;
  }

  /* Gambar utama */

  .product-image {
    display: block;
    flex: 0 0 100%;
    width: 100%;
    height: 390px;
    max-height: none;
    aspect-ratio: auto;
    object-fit: cover;
    padding: 0;
    margin: 0;
    background: #f7f9f7;
    border: 0;
    border-radius: 0;
  }

  /* Thumbnail horizontal */

  .product-thumbnail {
    flex: 0 0 58px;
    width: 58px;
    height: 58px;

    padding: 4px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e6ebe7;
    border-radius: 9px;
  }

  .product-gallery > .product-thumbnail:first-of-type {
    margin-left: 15px;
  }

  .product-thumbnail img {
    display: block;

    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .product-thumbnail.active {
    border: 1.5px solid #16845b;
  }
  /* =========================
     4. PRODUCT INFORMATION
  ========================= */

  .product-detail-content {
    width: 100%;
    min-width: 0;
    padding: 20px 17px 0;
  }

  .product-category {
    display: inline-block;
    margin-bottom: 7px;
    color: #16845b;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.7px;
    text-transform: uppercase;
  }

  .product-title {
    margin: 0 0 12px;
    color: #202c27;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.5px;
  }

  .product-price-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
  }

  .product-price {
    margin: 0;
    color: #16845b;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
  }

  .product-old-price {
    margin: 0;
    color: #9aa39e;
    font-size: 13px;
    text-decoration: line-through;
  }

  .product-description {
    margin: 0;
    color: #68736d;
    font-size: 12px;
    line-height: 1.8;
  }

  /* =========================
     5. PURCHASE AREA
  ========================= */

  .product-purchase {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    margin: 0;
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid #edf0ed;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .product-quantity {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    margin: 0;
    height: 42px;
    border: 1px solid #e5eae6;
    border-radius: 9px;
    background: #fff;
  }

  .product-quantity-btn {
    width: 30px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #34433b;
    background: transparent;
    border: 0;
  }

  .product-quantity-btn svg {
    width: 14px;
    height: 14px;
  }

  .product-quantity-input {
    width: 27px;
    height: 38px;
    padding: 0;
    text-align: center;
    color: #202c27;
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 12px;
    font-weight: 600;
    appearance: textfield;
    -moz-appearance: textfield;
  }

  .product-quantity-input::-webkit-inner-spin-button,
  .product-quantity-input::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
  }

  .product-add-to-cart {
    flex: 1;
    min-width: 0;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 12px;
    color: #fff;
    background: #16845b;
    border: 0;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
  }

  .product-add-to-cart svg {
    width: 17px;
    height: 17px;
  }

  .product-open-cart {
    display: none;
  }

  /* =========================
     6. PRODUCT INFO
  ========================= */

  .product-info {
    margin-top: 18px;
    border-radius: 12px;
  }

  .product-info-toggle {
    min-height: 52px;
    padding: 14px 15px;
    font-size: 14px;
  }

  .product-info-toggle .lucide {
    width: 18px;
    height: 18px;
  }

  .product-info-content {
    padding: 12px 15px 16px;
  }

  /* =========================
     7. HIGHLIGHTS
  ========================= */

  .product-highlights {
    padding: 24px 17px;
    margin: 0;
    background: #f7f9f7;
    border: 0;
    border-radius: 0;
  }

  .product-highlights h2 {
    margin: 0 0 15px;
    color: #26352d;
    font-size: 16px;
    line-height: 1.4;
  }

  .product-highlights-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .product-highlight-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: #56635b;
    font-size: 12px;
    line-height: 1.6;
  }

  .product-highlight-item svg {
    flex: 0 0 17px;
    width: 17px;
    height: 17px;
    margin-top: 1px;
    color: #16845b;
  }

  /* =========================
     8. CUSTOMER REVIEWS
  ========================= */

  .product-reviews {
    padding: 26px 17px;
    margin: 0;
    background: #fff;
    border: 0;
    border-radius: 0;
  }

  .product-reviews-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 15px;
  }

  .product-reviews-eyebrow {
    color: #16845b;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1px;
  }

  .product-reviews-header h2 {
    margin: 4px 0 0;
    color: #26352d;
    font-size: 17px;
  }

  .product-reviews-controls {
    display: none;
  }

  .product-reviews-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .product-reviews-track::-webkit-scrollbar {
    display: none;
  }

  .product-review-item {
    flex: 0 0 85%;
    min-width: 0;
    padding: 15px;
    background: #f8faf8;
    border: 1px solid #edf0ed;
    border-radius: 12px;
    scroll-snap-align: start;
  }

  .product-review-rating {
    display: flex;
    gap: 3px;
    margin-bottom: 9px;
    color: #e4a72e;
  }

  .product-review-rating svg {
    width: 13px;
    height: 13px;
    fill: currentColor;
  }

  .product-review-message {
    margin: 0 0 13px;
    color: #56635b;
    font-size: 12px;
    line-height: 1.7;
  }

  .product-review-image {
    width: 65px;
    height: 65px;
    margin-bottom: 12px;
    object-fit: cover;
    border-radius: 8px;
  }

  .product-review-author {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .product-review-author strong {
    color: #26352d;
    font-size: 11px;
  }

  .product-review-author span {
    color: #929b95;
    font-size: 10px;
  }

  /* =========================
     9. FAQ
  ========================= */

  .product-faq {
    padding: 25px 17px;
    margin: 0;
    background: #f7f9f7;
    border: 0;
    border-radius: 0;
  }

  .product-faq-header {
    margin-bottom: 15px;
  }

  .product-faq-header > span {
    color: #16845b;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1px;
  }

  .product-faq-header h2 {
    margin: 5px 0 0;
    color: #26352d;
    font-size: 17px;
    line-height: 1.4;
  }

  .product-faq-list {
    border-top: 1px solid #e7ece8;
  }

  .product-faq-item {
    border-bottom: 1px solid #e7ece8;
  }

  .product-faq-question {
    width: 100%;
    min-height: 53px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    color: #35443b;
    background: transparent;
    border: 0;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
  }

  .product-faq-question svg {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
  }

  .product-faq-answer {
    padding: 0 0 13px;
    color: #68736d;
    font-size: 11px;
    line-height: 1.8;
  }

  .product-faq-answer p {
    margin: 0;
  }

  /* =========================
     10. RECOMMENDATIONS
  ========================= */

  .product-recommendations {
    padding: 26px 17px 30px;
    margin: 0;
    background: #fff;
    border: 0;
    border-radius: 0;
  }

  .product-recommendations-header {
    margin-bottom: 15px;
  }

  .product-recommendations-header span {
    color: #16845b;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1px;
  }

  .product-recommendations-header h2 {
    margin: 5px 0 0;
    color: #26352d;
    font-size: 17px;
  }

  .product-recommendations-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .product-recommendations-grid::-webkit-scrollbar {
    display: none;
  }

  .recommendation-card {
    flex: 0 0 145px;
    min-width: 0;
    overflow: hidden;
    color: inherit;
    background: #fff;
    border: 1px solid #edf0ed;
    border-radius: 11px;
    text-decoration: none;
    scroll-snap-align: start;
  }

  .recommendation-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f7f9f7;
  }

  .recommendation-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .recommendation-info {
    padding: 10px;
  }

  .recommendation-info h3 {
    display: -webkit-box;
    overflow: hidden;
    margin: 0 0 5px;
    color: #26352d;
    font-size: 11px;
    line-height: 1.5;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .recommendation-info p {
    display: -webkit-box;
    overflow: hidden;
    margin: 0 0 8px;
    color: #87918a;
    font-size: 10px;
    line-height: 1.5;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .recommendation-info strong {
    color: #16845b;
    font-size: 12px;
  }

  /* =========================
     11. CART DRAWER
  ========================= */

  .cart-drawer {
    max-width: 100%;
  }

  /* =========================
     12. DETAIL MORE MENU
  ========================= */

  .detail-more-wrapper {
    position: relative;
  }

  .detail-more-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 180px;
    padding: 6px;
    background: #fff;
    border: 1px solid #e8edf0;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
    z-index: 1100;
  }

  .detail-more-menu[hidden] {
    display: none;
  }

  .detail-more-menu a,
  .detail-more-menu button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 11px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #263746;
    font: inherit;
    font-size: 13px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
  }

  .detail-more-menu a:hover,
  .detail-more-menu button:hover {
    background: #f1f5f9;
  }
}

/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 380px) {
  .product-title {
    font-size: 19px;
  }

  .product-price {
    font-size: 20px;
  }

  .product-purchase {
    gap: 7px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .product-quantity-btn {
    width: 26px;
  }

  .product-quantity-input {
    width: 23px;
  }

  .product-add-to-cart {
    font-size: 11px;
  }

  .recommendation-card {
    flex-basis: 135px;
  }
}
