/* ===== Product summary / Magento2-style buy box ===== */
.tp-m2-summary {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.tp-m2-summary-inner {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.04);
    margin-top: 0;
}

/* Header: title + price on right */
.tp-m2-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    height: auto;
}

.tp-m2-title-wrap .product_title {
    font-size: 1.6rem;
    margin: 0 0 4px;
    letter-spacing: 0.03em;
}

.tp-m2-sku {
    font-size: 0.85rem;
    color: #6f6a64;
}

.tp-m2-price-wrap {
    text-align: right;
    min-width: 110px;
}

.tp-m2-price-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #a08b7a;
}

.tp-m2-price-wrap .price {
    margin: 2px 0 0;
}

.tp-m2-price-wrap .woocommerce-Price-amount {
    font-size: 1.4rem;
    font-weight: 700;
    color: #624837;
}

/* Price reset (consolidated) */
.tp-m2-summary .price {
    float: none !important;
    position: static !important;
    margin: 0 !important;
}

/* Badges row (consolidated) */
.tp-m2-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    clear: both;
    margin-top: 6px;
}

.tp-m2-badge {
    font-size: 0.78rem;
    border-radius: 999px;
    padding: 3px 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: #f5f1ea;
    color: #4b3b30;
    white-space: nowrap;
}

.tp-m2-badge--in-stock {
    background: #e6f6ea;
    color: #166534;
    border-color: #bbf7d0;
}

.tp-m2-badge--pickup {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

/* Description */
.tp-m2-short {
    font-size: 0.92rem;
    line-height: 1.5;
    color: #4b3b30;
    margin-bottom: 14px;
}

.tp-m2-allergen {
    display: inline-block;
    margin-left: 4px;
    font-weight: 600;
    color: #b91c1c;
    font-size: 0.85rem;
}

/* BUY BOX layout */
.tp-m2-buybox {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    gap: 16px;
    align-items: flex-start;
    padding: 12px 12px 10px;
    border-radius: 10px;
    background: #f8f4ee;
    border: 1px solid rgba(0, 0, 0, 0.03);
    margin-bottom: 14px;
}

/* Qty */
.tp-m2-qty-block {
    min-width: 0;
}

.tp-m2-qty-label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.11em;
    color: #7a6a5d;
    margin-bottom: 4px;
}

.tp-m2-qty-wrap {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid #d1c4b8;
    overflow: hidden;
    background: #fff;
}

.tp-m2-qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #624837;
}

.tp-m2-qty-btn:hover {
    background: #f3f0eb;
}

.tp-m2-qty-input {
    width: 44px !important;
    border: none !important;
    text-align: center;
    font-size: 0.95rem;
    padding: 0;
    box-shadow: none;
}

.tp-m2-qty-input:focus {
    outline: none;
    box-shadow: none;
}

.tp-m2-qty-note {
    margin-top: 4px;
    font-size: 0.78rem;
    color: #7a6a5d;
}

/* CTA column */
.tp-m2-cta-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.tp-m2-addtocart {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px !important;
    padding: 10px 50px !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, #e6b26f, #c67a3f) !important;
    border: none !important;
    color: #1f130b !important;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-size: 0.82rem;
}

.tp-m2-addtocart:hover {
    filter: brightness(0.97);
}

.tp-m2-cart-icon {
    font-size: 1rem;
}

.tp-m2-cta-meta {
    font-size: 0.8rem;
    color: #6b5a4b;
}

.tp-m2-location-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 10px;
    background: #fff;
    border: 1px solid #e5ddd3;
    margin-bottom: 2px;
}

/* Reassurance row */
.tp-m2-reassure {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    border-top: 1px dashed #e0d5c9;
    padding-top: 10px;
    margin-top: 4px;
}

.tp-m2-reassure-item {
    font-size: 0.78rem;
    color: #7a6a5d;
}

/* Woo Stock/Availability Cleanup */
.tp-m2-summary .stock,
.tp-m2-summary .woocommerce-variation-availability,
.single-product .summary .stock {
    display: none !important;
}

/* ==== Product layout: gallery left, summary right (Desktop) ==== */
.tp-m2-layout,
.oneColContent .product {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-top: 10px;
}

/* left column: gallery */
.tp-m2-layout .woo-product-gallery-slider {
    flex: 0 0 42%;
    max-width: 480px;
    margin-bottom: 0;
}

.woo-product-gallery-slider {
    flex: 0 0 45%;
    max-width: 45%;
}

/* Kill inline Slick styles */
.woo-product-gallery-slider .slick-list,
.woo-product-gallery-slider .slick-track,
.woo-product-gallery-slider .woocommerce-product-gallery__image {
    width: 100% !important;
    left: 0 !important;
}

.woo-product-gallery-slider img {
    display: block;
    width: 100%;
    height: auto;
}

/* right column: summary */
.tp-m2-layout .tp-m2-summary {
    flex: 1 1 0;
    max-width: 650px;
}

.tp-m2-summary {
    flex: 1 1 0;
    max-width: 55%;
    margin-left: 0;
    margin-right: 0;
}

/* ====== PRODUCT GALLERY / VARIANT CAROUSEL ====== */

.woo-product-gallery-slider.woocommerce-product-gallery.wpgs--with-images.images {
    max-width: 620px;
    margin: 0 auto 20px;
}

/* Main image wrapper */
.tp-main-image-wrap {
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    background: #f5f1ea;
}

#tp-main-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Thumbs container: Retained for Flex setup around Swiper */
.tp-prod-thumbs {
    /* display: flex; REMOVED by Swiper base styles on .swiper */
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

/* Arrow buttons: REMOVED as Swiper takes over this styling */
/* .tp-prod-thumb-arrow {} */

/* Track: horizontal strip of thumbs: REMOVED, Swiper handles wrapper styles */
/* .tp-prod-thumbs-track {} */

/* Optional: nicer scrollbar on desktop: REMOVED, Swiper handles its own scrollbars/layout */
/* .tp-prod-thumbs-track::-webkit-scrollbar {} */
/* .tp-prod-thumbs-track::-webkit-scrollbar-thumb {} */

/* Each thumb button: Retained, though button inside slide is now better */
.tp-prod-thumb {
    flex: 0 0 auto;
    /* border: 0; REMOVED, apply to button inside */
    /* padding: 0; REMOVED, apply to button inside */
    background: none;
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    opacity: 0.8;
    transition: transform .12s ease, opacity .12s ease, box-shadow .12s ease;
}

.tp-prod-thumb img {
    display: block;
    /* width: 79px !important; */
    height: 65px !important;
    object-fit: cover;
    padding: 2px;
    margin-left: -2px;
}

/* Active thumb */
.tp-prod-thumb.is-active {
    opacity: 1;
    box-shadow: 0 0 0 2px #e5b26f;
    transform: translateY(-1px);
}

.tp-pulse {
    animation: tp-pulse 0.4s ease-out;
}

@keyframes tp-pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}


/* ===== Related products / Magento2-style grid ===== */

.tp-related {
    margin-top: 40px;
    text-align: center;
}

.tp-related > h2 {
    font-size: 1.35rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #5a3b2a;
    margin: 0 0 18px;
}

/* Centered row, wraps nicely */
.tp-related-grid {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;   /* <-- centers the row */
    gap: 24px;
    max-width: 1300px;         /* optional: keep it from going crazy wide */
}

/* Cards: fixed-ish width so centering looks clean */
.tp-related-item {
    flex: 0 1 280px;           /* basis ~280px, shrink if needed */
    max-width: 320px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    padding: 14px 14px 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.10);
    border: 1px solid rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.tp-related-price {
    margin-bottom: 10px;
}

.tp-related-title {
    font-size: 19px;
    font-weight: 700;
    /* line-height: 24px; */
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-top: 10px;
}

/* (Keep the rest as you already have: .tp-related-link, img, title, price, button, etc.) */

/* Mobile tweaks – flex will naturally stack, but you can tighten gaps if you want */
@media (max-width: 640px) {
    .tp-related-grid {
        gap: 16px;
    }
}

/* === Responsive tweaks === */

/* Tablet/Small Desktop Layout: Stack gallery/summary (max-width: 900px) */
@media (max-width: 900px) {
    .tp-m2-layout {
        display: block;
    }

    .tp-m2-layout .woo-product-gallery-slider {
        margin-bottom: 12px;
    }

    .tp-m2-layout .tp-m2-summary {
        width: 100% !important;
        max-width: 100%;
        margin: 0 auto 16px;
    }
}

/* Mobile / Tablet (max-width: 768px) */
@media (max-width: 768px) {
    /* Header/Price Layout */
    .tp-m2-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .tp-m2-price-wrap {
        text-align: left;
        display: flex;
        align-items: baseline;
        gap: 6px;
        margin-top: 2px;
    }

    .tp-m2-price-label {
        font-size: 0.9rem;
        text-transform: none;
        letter-spacing: 0;
        color: #7a6a5d;
    }

    .tp-m2-price-wrap .price {
        margin: 0;
    }

    /* Buybox Layout */
    .tp-m2-buybox {
        grid-template-columns: 1fr;
    }

    /* Full Product Layout (oneColContent) */
    .oneColContent .product {
        flex-direction: column;
        gap: 12px;
    }

    .woo-product-gallery-slider {
        flex: 0 0 auto;
        max-width: 100%;
        width: 100%;
        margin: 0 auto 8px;
        overflow: hidden;
    }

    .woo-product-gallery-slider .slick-list,
    .woo-product-gallery-slider .slick-track,
    .woo-product-gallery-slider .woocommerce-product-gallery__image {
        width: 100% !important;
    }

    .tp-m2-summary {
        max-width: 100%;
        width: 100% !important;
    }

    /* Hide breadcrumb on mobile */
    #woocommerce-breadcrumb,
    nav.woocommerce-breadcrumb[aria-label="Breadcrumb"] {
        display: none;
    }

    /* Mobile gallery tweaks */
    .woo-product-gallery-slider.woocommerce-product-gallery.wpgs--with-images.images {
        margin-bottom: 14px;
    }
}
