/* ═══════════════════════════════════════════════════════════════════════════
   Leon Dio — Single Product Page
   Rebuilt to match reference design (Âu Lạc Chu Nhai screenshot)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Safety net: content below fixed header — mobile only ────────────────── */
@media (max-width: 768px) {
    body.single-product:not(.ld-has-header) #single-product-page { padding-top: 92px; }
    body.admin-bar.single-product:not(.ld-has-header) #single-product-page { padding-top: 124px; }
}

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.sp-breadcrumb {
    background: #f5f5f5;
    border-bottom: 1px solid #e8e8e8;
    padding: 14px 0;
}
.breadcrumb-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}
.breadcrumb-nav a {
    color: #999;
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumb-nav a:hover { color: var(--primary); }
.breadcrumb-nav .sep { color: #ccc; }
.breadcrumb-nav .current { color: var(--text-dark); font-weight: 500; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.sp-hero {
    background: #fff;
    padding: 60px 0 70px;
}
.sp-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 70px;
    align-items: start;
}

/* ── Gallery ──────────────────────────────────────────────────────────────── */
.sp-gallery {
    position: sticky;
    top: 108px;
}

/* Main image — square, magnifier zoom on hover */
.sp-main-image {
    background: #f7f7f7;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    overflow: hidden;
    cursor: zoom-in;
    position: relative;
}
.sp-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border: 1px solid #e8e8e8;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: center center;
}
.sp-main-image:hover img {
    transform: scale(1.55);
}

/* Thumbnails — 5 hình/row, wrap xuống hàng nếu nhiều hơn */
.sp-thumbnails {
    display: flex;
    gap: 8px;
    flex-wrap: wrap; /* wrap khi > 5 hình */
}
.sp-thumb {
    flex: 0 0 calc((100% - 32px) / 5); /* 5 per row: (100% - 4×8px) / 5 */
    min-width: 0;
    border: 2px solid #e0e0e0;
    background: #f7f7f7;
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    transition: border-color 0.25s;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sp-thumb img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    display: block;
}
.sp-thumb:hover  { border-color: #bbb; }
.sp-thumb.active { border-color: var(--primary); }

/* ── Product Info ─────────────────────────────────────────────────────────── */
.sp-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.sp-sku-top {
    font-size: 11px;
    color: #bbb;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.sp-title {
    font-family: var(--font-heading);
    font-size: 34px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.25;
    margin: 0;
}

/* ── Rating ───────────────────────────────────────────────────────────────── */
.sp-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.sp-rating .star-rating {
    font-size: 15px;
    color: #f0c040;
    overflow: visible;
    width: auto !important;
}
.sp-rating .star-rating::before,
.sp-rating .star-rating span::before {
    color: #f0c040;
}
.sp-review-link {
    font-size: 13px;
    color: #999;
    text-decoration: none;
    border-bottom: 1px solid #ddd;
    transition: color 0.2s, border-color 0.2s;
    cursor: pointer;
}
.sp-review-link:hover { color: var(--primary); border-color: var(--primary); }

/* ── Price — sale price FIRST, original second ───────────────────────────── */
.sp-price {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}
/* WooCommerce HTML order: <del> then <ins> — flip visually with order */
.sp-price ins  { order: 1; text-decoration: none; }
.sp-price del  { order: 2; }
.sp-price ins .woocommerce-Price-amount {
    color: var(--primary);
    font-size: 28px;
    font-weight: 700;
}
/* "VND" suffix nhỏ hơn số tiền */
.sp-price ins .woocommerce-Price-amount .woocommerce-Price-currencySymbol,
.sp-price ins .woocommerce-Price-amount bdi > .woocommerce-Price-currencySymbol {
    font-size: 15px;
    font-weight: 500;
    vertical-align: baseline;
    opacity: 0.75;
}
.sp-price del .woocommerce-Price-amount {
    color: #aaa;
    font-size: 15px;
    font-weight: 400;
}
/* Simple product (no sale) — single price */
.sp-price > .woocommerce-Price-amount {
    color: var(--primary);
    font-size: 28px;
    font-weight: 700;
}
.sp-price > .woocommerce-Price-amount .woocommerce-Price-currencySymbol {
    font-size: 15px;
    font-weight: 500;
    vertical-align: baseline;
    opacity: 0.75;
}

/* ── Short Description ────────────────────────────────────────────────────── */
.sp-short-desc {
    font-size: 14px;
    line-height: 1.85;
    color: var(--text-muted);
    border-top: 1px solid #f0f0f0;
    padding-top: 16px;
}
.sp-short-desc p { margin: 0 0 10px; }

/* Top-level bullet list */
.sp-short-desc ul {
    padding-left: 20px;
    margin: 8px 0 0;
}
.sp-short-desc ul > li {
    list-style: disc;
    margin-bottom: 6px;
}

/* Nested ordered list (ol inside ul li) */
.sp-short-desc ul > li > ol {
    list-style: decimal;
    padding-left: 20px;
    margin: 6px 0 4px;
    border-left: 2px solid #e8e8e8;
}
.sp-short-desc ul > li > ol > li {
    list-style: decimal;
    margin-bottom: 4px;
    font-size: 13px;
    color: #888;
}

/* Nested ul inside ul (phòng trường hợp có ul lồng nhau) */
.sp-short-desc ul ul {
    list-style: circle;
    padding-left: 20px;
    margin: 6px 0 4px;
}

/* ── Action block wrapper ─────────────────────────────────────────────────── */
.sp-action-block {
    padding-top: 24px;
    border-top: 1px solid #ebebeb;
    margin-top: 4px;
}

/* Group: dùng CSS Grid 2 cột để căn trái chuẩn */
.sp-atc-group {
    display: grid;
    grid-template-columns: 100px 1fr;   /* col1 = qty, col2 = ATC area */
    column-gap: 10px;
    row-gap: 10px;
    max-width: 460px;
}
.sp-qty-label {
    grid-column: 1 / -1;                /* span toàn bộ */
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #555;                        /* đậm hơn */
    margin-bottom: -4px;
}
.sp-atc-wrapper {
    grid-column: 1 / -1;                /* form tự xử lý qty + button bên trong */
}

/* ── Consultation ─────────────────────────────────────────────────────────── */
.sp-consult {
    grid-column: 1 / -1;        /* span full — label canh trái form.cart */
    display: grid;
    grid-template-columns: 100px 1fr 1fr; /* khớp cột cha: qty | btn-50% | btn-50% */
    column-gap: 10px;           /* khớp gap cha */
    align-items: center;
}
.sp-consult-label {
    /* col 1 — cùng x=0 với form.cart */
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #555;
    white-space: nowrap;
}
.sp-consult-sep { display: none; }
.sp-consult-link {
    display: flex;
    align-items: center;
    justify-content: center;   /* căn giữa trong ô 50% */
    gap: 7px;
    padding: 9px 8px;
    border-radius: 2px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: filter 0.2s, transform 0.15s;
    line-height: 1;
}
.sp-consult-link:hover { filter: brightness(1.1); transform: translateY(-1px); text-decoration: none; }
.sp-zalo-link  { background: #0068FF; color: #fff !important; }
.sp-zalo-link img { flex-shrink: 0; width: 16px; height: 16px; object-fit: contain; }
.sp-phone-link { background: #e60808; color: #fff !important; }
.sp-phone-link i { font-size: 12px; }

/* ── Sticky sidebar (desktop) + mobile bottom bar ─────────────────────────── */
.sp-mobile-bar {
    /* Desktop: vertical stack cố định bên phải màn hình */
    display: flex;
    flex-direction: column;
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9990;
    gap: 2px;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
}
.sp-mb-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 64px;
    padding: 14px 6px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    border: none;
    line-height: 1;
    transition: opacity 0.18s, width 0.2s;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    overflow: hidden;
}
.sp-mb-btn i            { font-size: 20px; }
.sp-mb-btn svg          { width: 22px; height: 22px; }
.sp-mb-btn img          { width: 22px; height: 22px; object-fit: contain; }
.sp-mb-btn:hover, .sp-mb-btn:active { opacity: 0.85; text-decoration: none; }
.sp-mb-zalo  { background: #0068FF; color: #fff !important; }
.sp-mb-phone { background: #e60808; color: #fff !important; }
.sp-mb-cart  { background: var(--primary); color: #fff !important; }

/* ── Add to Cart ──────────────────────────────────────────────────────────── */

/* Simple product: qty + button nằm ngang */
.sp-atc-wrapper form.cart:not(.variations_form) {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    flex-wrap: nowrap;
    width: 100%;
}

/* Variable product: block layout — variations table xếp dọc trên qty+button */
.sp-atc-wrapper .variations_form {
    display: block;
    margin: 0;
    width: 100%;
}
.sp-atc-wrapper .single_variation_wrap {
    display: block;
}
/* Qty + button nằm ngang bên trong variation form */
.sp-atc-wrapper .woocommerce-variation-add-to-cart {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

/* ── chowordpress_quantity_select (woocommerce-custom.php override) ─────── */
.sp-atc-wrapper .chowordpress_quantity_select {
    float: none !important;       /* override inline float:left */
    display: flex;
    align-items: center;
    flex-shrink: 0;
    width: 100px;                 /* khớp với grid col1 */
    border: 1px solid var(--secondary);
    background: #fff;
    height: 52px;
    padding: 0 4px;
}
.sp-atc-wrapper .chowordpress_qty {
    height: 44px;
    min-width: 72px;
    padding: 0 10px;
    border: none;
    outline: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    background: transparent;
    cursor: pointer;
    appearance: auto;
}

/* Standard WooCommerce quantity (fallback) */
.sp-atc-wrapper .quantity {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--secondary);
    background: #fff;
    height: 52px;
    flex-shrink: 0;
    width: 100px;                 /* khớp với grid col1 */
}
.sp-atc-wrapper .quantity input.qty {
    width: 48px;
    border: none;
    outline: none;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    background: transparent;
    -moz-appearance: textfield;
    padding: 0;
}
.sp-atc-wrapper .quantity input.qty::-webkit-outer-spin-button,
.sp-atc-wrapper .quantity input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
/* ±  buttons (injected by JS when standard qty input exists) */
.qty-btn {
    width: 42px;
    background: #fff;
    border: none;
    font-size: 20px;
    font-weight: 300;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
    padding: 0;
}
.qty-btn:hover { background: var(--secondary); color: #fff; }

/* Add to cart button — override WooCommerce default purple with !important */
.sp-atc-wrapper .single_add_to_cart_button,
.sp-atc-wrapper .single_add_to_cart_button.button,
.sp-atc-wrapper .single_add_to_cart_button.alt,
.sp-atc-wrapper button.single_add_to_cart_button {
    flex: 1;
    height: 52px;
    background-color: #1a1a1a !important;
    background: #1a1a1a !important;
    color: #fff !important;
    border: 1px solid #1a1a1a !important;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
    padding: 0 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0;
    white-space: nowrap;
    border-radius: 0;
    box-shadow: none !important;
    text-shadow: none !important;
}
.sp-atc-wrapper .single_add_to_cart_button:hover,
.sp-atc-wrapper .single_add_to_cart_button:focus,
.sp-atc-wrapper button.single_add_to_cart_button:hover {
    background-color: var(--primary) !important;
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}
/* Loading spinner */
.sp-atc-wrapper .single_add_to_cart_button.loading {
    opacity: 0.75;
}
.sp-atc-wrapper .single_add_to_cart_button.loading::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sp-spin 0.7s linear infinite;
    display: inline-block;
    margin-left: 8px;
    flex-shrink: 0;
}
@keyframes sp-spin { to { transform: rotate(360deg); } }

/* Variable product
   Dùng :has(.variations_form) thay vì body.product-type-variable
   vì WooCommerce không phải lúc nào cũng thêm class đó vào <body>.
   :has() được support Chrome 105+, Safari 15.4+, Firefox 121+ — đủ dùng.
*/

/* 1. Ẩn sp-qty-label khi có variations_form bên trong wrapper */
.sp-atc-group:has(.variations_form) .sp-qty-label,
body.product-type-variable .sp-qty-label { display: none; }

/* 2. Qty+button row: cho phép wrap để ::before chiếm hàng đầu riêng */
.sp-atc-wrapper:has(.variations_form) .woocommerce-variation-add-to-cart,
body.product-type-variable .woocommerce-variation-add-to-cart {
    flex-wrap: wrap;
    align-items: center;
}

/* 2b. Label "Số lượng" — flex-basis: 100% → qty+btn tự xuống hàng 2 */
.sp-atc-wrapper:has(.variations_form) .woocommerce-variation-add-to-cart::before,
body.product-type-variable .woocommerce-variation-add-to-cart::before {
    content: 'Số lượng';
    flex-basis: 100%;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 2px;
}

/* 3. Ẩn giá biến thể hiện trong form (đã hiển thị ở khu vực giá phía trên) */
.sp-atc-wrapper .woocommerce-variation-price { display: none !important; }

/* Variations table */
.sp-atc-wrapper .variations {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
    border-bottom: 1px solid #ebebeb;
    padding-bottom: 12px;
}
.sp-atc-wrapper .variations td,
.sp-atc-wrapper .variations th {
    padding: 6px 0;
    vertical-align: middle;
    border: none !important;
    background: transparent !important;
}
/* WooCommerce dùng <th class="label"> — KHÔNG phải <td class="label"> */
.sp-atc-wrapper .variations th.label,
.sp-atc-wrapper .variations th.label label {
    width: 100px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #555;
    padding-right: 10px;
    white-space: nowrap;
    font-family: inherit;
    text-align: left;
    vertical-align: middle;
}
.sp-atc-wrapper a.reset_variations { display: none !important; }
.sp-atc-wrapper .variations select {
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d0d0d0;
    font-size: 14px;
    outline: none;
    width: 100%;
    background: #fff;
}
.sp-atc-wrapper a.reset_variations {
    font-size: 12px;
    color: #aaa;
    display: inline-block;
    margin-top: 4px;
}

/* ── Meta ─────────────────────────────────────────────────────────────────── */
.sp-meta {
    border-top: 1px solid #ebebeb;
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.sp-meta-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 13px;
    line-height: 1.6;
}
.sp-meta-label { color: #999; min-width: 72px; flex-shrink: 0; }
.sp-meta-value { color: var(--text-dark); }
.sp-meta-value a { color: var(--text-dark); text-decoration: none; }
.sp-meta-value a:hover { color: var(--primary); }

/* ── WooCommerce notices ──────────────────────────────────────────────────── */
.woocommerce-notices-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
    padding: 12px 20px;
    margin: 12px 0;
    font-size: 14px;
    list-style: none;
    border-left: 3px solid var(--primary);
    background: #fffbf4;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════════════════════════════════ */
.sp-tabs-section {
    background: #fff;
    border-top: 1px solid #ebebeb;
    padding: 0 0 70px;
}
.sp-tab-nav {
    display: flex;
    border-bottom: 2px solid #e8e8e8;
    margin-bottom: 48px;
    gap: 0;
}
.sp-tab-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 20px 30px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #999;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.sp-tab-btn:hover { color: var(--text-dark); }
.sp-tab-btn.active {
    color: var(--text-dark);
    border-bottom-color: var(--primary);
}

.sp-tab-panel { display: none; }
.sp-tab-panel.active { display: block; }

/* Description content */
.sp-tab-panel .woocommerce-Tabs-panel--description,
.sp-tab-panel > * {
    font-size: 15px;
    line-height: 1.85;
    color: #555;
}
.sp-tab-panel h1, .sp-tab-panel h2, .sp-tab-panel h3,
.sp-tab-panel h4, .sp-tab-panel h5 {
    font-family: var(--font-heading);
    color: var(--text-dark);
    font-weight: 600;
    margin: 36px 0 12px;
    line-height: 1.3;
}
.sp-tab-panel h3 { font-size: 22px; }
.sp-tab-panel h2 { font-size: 26px; }
.sp-tab-panel p  { margin-bottom: 16px; }
.sp-tab-panel ul, .sp-tab-panel ol {
    padding-left: 22px;
    margin-bottom: 16px;
}
.sp-tab-panel li { margin-bottom: 6px; }

/* Images inside description */
.sp-tab-panel img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 32px auto;
}
.sp-tab-panel figure { margin: 32px 0; }

/* Responsive video embeds — override width/height HTML attributes */
.sp-tab-panel iframe,
.sp-tab-panel embed,
.sp-tab-panel object {
    display: block !important;
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
}
/* <p> wrapper chứa iframe cũng cần overflow: hidden */
.sp-tab-panel p:has(> iframe) {
    overflow: hidden;
    max-width: 100%;
}
/* WordPress block embed wrapper */
.sp-tab-panel .wp-block-embed__wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}
.sp-tab-panel .wp-block-embed__wrapper iframe {
    position: static;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
}

/* Additional info table */
.sp-tab-panel .woocommerce-product-attributes {
    width: 100%;
    border-collapse: collapse;
}
.sp-tab-panel .woocommerce-product-attributes th,
.sp-tab-panel .woocommerce-product-attributes td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid #ebebeb;
    text-align: left;
    vertical-align: middle;
}
.sp-tab-panel .woocommerce-product-attributes th {
    font-weight: 600;
    color: var(--text-dark);
    width: 33%;
    background: #f9f9f9;
}
.sp-tab-panel .woocommerce-product-attributes td { color: #555; }

/* Reviews */
#sp-tab-reviews { padding: 0; }
.sp-tab-panel .woocommerce-Reviews-title {
    font-size: 20px;
    margin-bottom: 28px;
}
.sp-tab-panel .comment-form label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 6px;
}
.sp-tab-panel input[type="text"],
.sp-tab-panel input[type="email"],
.sp-tab-panel textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d0d0d0;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    background: #fff;
}
.sp-tab-panel input[type="submit"],
.sp-tab-panel .submit input {
    background: var(--secondary);
    color: #fff;
    border: none;
    padding: 13px 32px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
}
.sp-tab-panel input[type="submit"]:hover,
.sp-tab-panel .submit input:hover { background: var(--primary); }
/* Stars rating in review form */
.sp-tab-panel .stars a { color: #f0c040; font-size: 22px; text-decoration: none; }
.sp-tab-panel .comment-list { margin: 0; padding: 0; list-style: none; }
.sp-tab-panel .comment-list li { border-bottom: 1px solid #ebebeb; padding: 20px 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   RELATED PRODUCTS
   ═══════════════════════════════════════════════════════════════════════════ */
.sp-related {
    background: #f7f7f7;
    border-top: 1px solid #ebebeb;
    padding: 60px 0 70px;
}
.sp-related .section-title {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
    margin: 0 0 48px;
}

/* product-grid, product-card etc. come from assets-leon-dio/style.css */
.sp-related .product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.sp-related .product-card { background: #fff; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
    .sp-layout { grid-template-columns: 1fr 1fr; gap: 40px; }
    .sp-related .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
    .sp-layout {
        grid-template-columns: 1fr;
        gap: 36px;
    }
    .sp-gallery {
        position: static;
        max-width: 520px;
        margin: 0 auto;
        width: 100%;
    }
    .sp-title { font-size: 28px; }
    .sp-related .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    /* Chuyển sticky bar từ right-edge → bottom bar */
    .sp-mobile-bar {
        flex-direction: row;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        transform: none;
        border-top: 1px solid #ddd;
        box-shadow: 0 -4px 24px rgba(0,0,0,0.13);
        padding: 10px 12px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
        gap: 8px;
        align-items: stretch;
    }
    .sp-mb-btn {
        flex: 1;
        flex-direction: row;    /* icon + text cùng hàng */
        gap: 6px;
        width: auto;
        padding: 14px 6px;
        font-size: 12px;
    }
    .sp-mb-btn i, .sp-mb-btn svg { font-size: 16px; width: 16px; height: 16px; }
    .sp-mb-cart { flex: 1.6; }
    /* Extra bottom padding so bar doesn't overlap content */
    #single-product-page { padding-bottom: 60px; }
    /* Hide consultation strip (covered by sticky bar) */
    .sp-consult { display: none; }
    /* Ẩn breadcrumb trên mobile */
    .sp-breadcrumb { display: none; }
    /* Container padding */
    #single-product-page .container { padding-left: 20px; padding-right: 20px; }
    /* Ẩn Zalo widget & hotline ring — sp-mobile-bar đã thay thế */
    body.single-product .zalo-container,
    body.single-product .hotline-phone-ring-wrap { display: none !important; }
    /* Nâng back-to-top lên trên sp-mobile-bar */
    body.single-product #back-to-top { bottom: 80px; }
}

@media (max-width: 600px) {
    .sp-hero { padding: 36px 0 48px; }
    .sp-title { font-size: 24px; }
    .sp-price .woocommerce-Price-amount,
    .sp-price ins .woocommerce-Price-amount { font-size: 22px; }
    /* ATC form full-width on small mobile */
    .sp-atc-wrapper form.cart,
    .sp-atc-wrapper .variations_form { max-width: 100%; flex-wrap: wrap; }
    .sp-atc-wrapper .quantity { width: 100%; justify-content: center; }
    .sp-atc-wrapper .single_add_to_cart_button {
        width: 100%;
        margin-top: 10px;
    }
    .sp-tab-btn { padding: 14px 16px; font-size: 11px; letter-spacing: 1px; }
    .sp-related .product-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}
