/* ============================================================
   an_parachronoproductsections v2.0
   Targets real PrestaShop 1.7.8 classic structure:
   - section.product-accessories (accessories from product.tpl)
   - section > h2 + div.products (ps_crossselling)
   - section > h2 + div (ps_categoryproducts)
   - section.featured-products (ps_viewedproduct)
   All use catalog/_partials/miniatures/product.tpl
   JS adds .anps-section class to each detected section.
   ============================================================ */

/* ================================================================
   1. SECTION LAYOUT
   ================================================================ */

.anps-section {
    margin-top: var(--anps-section-sp, 48px) !important;
    padding: 0;
    position: relative;
    clear: both;
}

.anps-section.anps-alt-bg {
    background: var(--anps-section-bg, #F7FAFC);
    border-radius: var(--anps-section-r, 20px);
    padding: 32px !important;
}

/* ================================================================
   2. SECTION TITLE
   The accessories block uses <p class="h5 text-uppercase">
   All others use <h2>
   JS normalizes them with .anps-title class
   ================================================================ */

.anps-section .anps-title {
    font-size: var(--anps-title-size, 22px) !important;
    font-weight: 700 !important;
    color: var(--anps-title-color, #0A192F) !important;
    margin: 0 0 24px !important;
    padding: 0 !important;
    position: relative;
    line-height: 1.3;
    letter-spacing: -0.01em;
    text-transform: none !important;
}

/* ── underline ── */
.anps-section.anps-title-underline .anps-title {
    padding-bottom: 14px !important;
}

.anps-section.anps-title-underline .anps-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 48px;
    height: 3px;
    border-radius: 3px;
    background: var(--anps-accent, #0891B2);
}

/* ── badge ── */
.anps-section.anps-title-badge .anps-title {
    padding-left: 18px !important;
}

.anps-section.anps-title-badge .anps-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    bottom: 3px;
    width: 4px;
    border-radius: 4px;
    background: var(--anps-accent, #0891B2);
}

/* ── plain ── no decoration */

/* ================================================================
   3. PRODUCTS CONTAINER
   Accessories uses .products.row with Bootstrap cols
   Others use .products or bare div
   JS adds .anps-products class
   ================================================================ */

/* Reset Bootstrap row/col when we take control */
.anps-section .anps-products {
    display: flex;
    flex-wrap: wrap;
    gap: var(--anps-gap, 20px);
    padding: 8px;
    margin: -8px;
}

/* Remove Bootstrap grid classes from items */
.anps-section .anps-products > .js-product {
    width: auto;
    max-width: none;
    padding: 0;
    flex: none;
}

/* Grid mode: compute widths */
.anps-section .anps-products.anps-grid > .js-product {
    width: calc((100% - var(--anps-gap, 20px) * 3) / 4);
}

@media (max-width: 991px) {
    .anps-section .anps-products.anps-grid > .js-product {
        width: calc((100% - var(--anps-gap, 20px) * 2) / 3);
    }
}

@media (max-width: 767px) {
    .anps-section .anps-products.anps-grid > .js-product {
        width: calc((100% - var(--anps-gap, 20px)) / 2);
    }
}

/* ================================================================
   4. CAROUSEL
   ================================================================ */

.anps-section .anps-carousel-wrapper {
    position: relative;
    padding: 0 52px;
}

.anps-section .anps-viewport {
    overflow: hidden;
    padding: 8px 0;
    margin: -8px 0;
}

.anps-section .anps-track {
    display: flex;
    transition-property: transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.anps-section .anps-track > .js-product {
    flex-shrink: 0;
    box-sizing: border-box;
    width: auto;
    max-width: none;
    padding: 0;
}

/* ── Arrows ── */
.anps-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #fff;
    border: 1.5px solid #E2E8F0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s;
    color: #4A5568;
    padding: 0;
    outline: none;
}

.anps-arrow:hover {
    background: var(--anps-accent, #0891B2);
    border-color: var(--anps-accent, #0891B2);
    color: #fff;
    box-shadow: 0 4px 16px rgba(8, 145, 178, 0.25);
}

.anps-arrow svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.anps-arrow-prev { left: 0; }
.anps-arrow-next { right: 0; }

.anps-arrow.is-disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* ── Dots ── */
.anps-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding: 0;
    list-style: none;
}

.anps-dot {
    width: 8px;
    height: 8px;
    border-radius: 8px;
    background: #CBD5E0;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
}

.anps-dot.is-active {
    background: var(--anps-accent, #0891B2);
    width: 28px;
}

/* ================================================================
   5. PRODUCT MINIATURE CARDS
   Real structure: article.product-miniature > div.thumbnail-container
   ================================================================ */

.anps-section .product-miniature {
    transition: all 0.3s ease;
}

.anps-section .thumbnail-container {
    border-radius: var(--anps-card-r, 14px);
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ── Card style: elevated ── */
.anps-section.anps-card-elevated .thumbnail-container {
    background: #fff;
    border: 1px solid #EDF2F7;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* ── Card style: flat ── */
.anps-section.anps-card-flat .thumbnail-container {
    background: #fff;
    border: none;
    box-shadow: none;
}

/* ── Card style: bordered ── */
.anps-section.anps-card-bordered .thumbnail-container {
    background: #fff;
    border: 1.5px solid #E2E8F0;
    box-shadow: none;
}

/* ── Hover effects ── */
.anps-section.anps-hover-lift .thumbnail-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    border-color: var(--anps-accent, #0891B2);
}

.anps-section.anps-hover-glow .thumbnail-container:hover {
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.15), 0 8px 24px rgba(8, 145, 178, 0.1);
    border-color: var(--anps-accent, #0891B2);
}

.anps-section.anps-hover-border .thumbnail-container:hover {
    border-color: var(--anps-accent, #0891B2);
}

/* ── Image area: .thumbnail-top ── */
.anps-section .thumbnail-top {
    position: relative;
    overflow: hidden;
    background: #F7FAFC;
}

.anps-section .thumbnail-top .product-thumbnail img {
    transition: transform 0.4s ease;
    display: block;
    width: 100%;
    height: auto;
}

.anps-section .thumbnail-container:hover .thumbnail-top .product-thumbnail img {
    transform: scale(1.04);
}

/* ── Quick view overlay ── */
.anps-section .highlighted-informations {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    padding: 10px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    text-align: center;
    border-top: 1px solid #EDF2F7;
}

.anps-section .thumbnail-container:hover .highlighted-informations {
    transform: translateY(0);
}

.anps-section .quick-view {
    font-size: 12px;
    font-weight: 600;
    color: var(--anps-accent, #0891B2);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.anps-section .quick-view .material-icons {
    font-size: 16px;
    vertical-align: middle;
    margin-right: 2px;
}

/* Hide quick-view / variants / description if toggled off */
.anps-section.anps-hide-quickview .quick-view {
    display: none !important;
}

.anps-section.anps-hide-variants .variant-links {
    display: none !important;
}

.anps-section.anps-hide-desc .product-miniature .product-description-short,
.anps-section.anps-hide-desc .product-miniature .product-description > p,
.anps-section.anps-hide-desc .product-miniature .product-description > div:not(.product-price-and-shipping):not(.product-title):not([class]) {
    display: none !important;
}

/* ── Product description area ── */
.anps-section .product-description {
    padding: 12px 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.anps-section .product-title {
    margin: 0 0 8px;
}

.anps-section .product-title a {
    font-size: 13.5px !important;
    font-weight: 600;
    color: #1A202C;
    text-decoration: none;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.anps-section .thumbnail-container:hover .product-title a {
    color: var(--anps-accent, #0891B2);
}

/* ── Price ── */
.anps-section .product-price-and-shipping {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}

.anps-section .product-price-and-shipping .price {
    font-size: 17px;
    font-weight: 800;
    color: #0A192F;
    line-height: 1;
}

.anps-section .product-price-and-shipping .regular-price {
    font-size: 13px;
    color: #A0AEC0;
    text-decoration: line-through;
    font-weight: 400;
}

.anps-section .product-price-and-shipping .discount-product {
    font-size: 11px;
    font-weight: 700;
    color: #E53E3E;
    background: #FFF5F5;
    padding: 2px 6px;
    border-radius: 4px;
}

/* ── Quantity + Add to cart in miniatures ── */
.anps-section .product-miniature .product-quantity,
.anps-section .product-miniature .product-actions,
.anps-section .product-miniature .product-add-to-cart {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 14px 14px;
}

.anps-section .product-miniature .product-quantity .qty,
.anps-section .product-miniature .product-actions .qty {
    display: flex;
    align-items: center;
    gap: 6px;
}

.anps-section .product-miniature .product-quantity #quantity_wanted,
.anps-section .product-miniature .product-quantity input[name="qty"],
.anps-section .product-miniature .product-actions input[type="number"] {
    width: 100%;
    height: 38px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    color: #1A202C;
    background: #fff;
    outline: none;
    -moz-appearance: textfield;
    transition: border-color 0.2s;
}

.anps-section .product-miniature .product-quantity input:focus,
.anps-section .product-miniature .product-actions input:focus {
    border-color: var(--anps-accent, #0891B2);
}

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

.anps-section .product-miniature .input-group-btn-vertical {
    display: flex;
    flex-direction: row;
    gap: 4px;
}

.anps-section .product-miniature .input-group-btn-vertical .btn {
    width: 32px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    background: #F7FAFC;
    color: #4A5568;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    transition: all 0.15s;
}

.anps-section .product-miniature .input-group-btn-vertical .btn:hover {
    border-color: var(--anps-accent, #0891B2);
    color: var(--anps-accent, #0891B2);
    background: #F0FDFA;
}

.anps-section .product-miniature .add-to-cart,
.anps-section .product-miniature .ajax_add_to_cart_button,
.anps-section .product-miniature button[data-button-action="add-to-cart"] {
    width: 100% !important;
    height: 40px !important;
    border-radius: 10px !important;
    border: none !important;
    background: var(--anps-accent, #0891B2) !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.2s !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px;
}

.anps-section .product-miniature .add-to-cart:hover,
.anps-section .product-miniature .ajax_add_to_cart_button:hover,
.anps-section .product-miniature button[data-button-action="add-to-cart"]:hover {
    background: #06B6D4 !important;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.2);
}

.anps-section .product-miniature .add-to-cart i,
.anps-section .product-miniature .add-to-cart .material-icons {
    font-size: 16px !important;
}

/* ── Product flags (new, promo, etc.) ── */
.anps-section .product-flags {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.anps-section .product-flag {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.2;
}

.anps-section .product-flag.discount,
.anps-section .product-flag.on-sale {
    background: #E53E3E;
    color: #fff;
}

.anps-section .product-flag.new {
    background: var(--anps-accent, #0891B2);
    color: #fff;
}

/* ================================================================
   6. MOBILE
   ================================================================ */

@media (max-width: 767px) {
    .anps-section {
        margin-top: calc(var(--anps-section-sp, 48px) * 0.65) !important;
    }

    .anps-section.anps-alt-bg {
        padding: 20px 16px !important;
        border-radius: calc(var(--anps-section-r, 20px) * 0.7);
    }

    .anps-section .anps-title {
        font-size: calc(var(--anps-title-size, 22px) - 3px) !important;
        margin-bottom: 18px !important;
    }

    .anps-section .anps-carousel-wrapper {
        padding: 0 40px;
    }

    .anps-arrow {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .anps-arrow svg {
        width: 15px;
        height: 15px;
    }

    .anps-section .product-title a {
        font-size: 12px !important;
    }

    .anps-section .product-price-and-shipping .price {
        font-size: 15px;
    }

    .anps-section .product-description {
        padding: 10px 10px 12px;
    }
}

@media (max-width: 479px) {
    .anps-section .anps-carousel-wrapper {
        padding: 0 34px;
    }

    .anps-arrow {
        width: 28px;
        height: 28px;
        border-radius: 8px;
    }
}
