/* ============================================================
   product-carousel.css
   Styles for the reusable ProductCarousel component.

   HOW SCOPING WORKS:
   Every carousel instance gets a unique prefix  pc-{id}-
   set via the CSS custom property  --pc-prefix  on the
   section element.  Because CSS can't use custom properties
   inside selectors, we instead use a  data-pc-id  attribute
   on the section and write attribute selectors below.

   In practice the PHP outputs  data-pc-id="new"  and every
   class is  pc-{id}-*  so the attribute selector
   [data-pc-id="new"]  gives you full scoping with zero
   duplication.

   If you prefer a single global stylesheet (no scoping),
   just use the  .pc-*  base classes and don't pass a
   section_id — they map 1-to-1.
   ============================================================ */

/* ── Reset / base ──────────────────────────────────────────── */
.pc-section {
    padding: 60px 0;
}

/* ── CSS variables (overridden per-instance via inline style) ── */
.pc-carousel {
    --pc-primary : #ff9800;
    --pc-border  : #f0f0f0;
    --pc-text    : #333;
    --pc-muted   : #777;

    width    : calc(100% - 100px);
    padding  : 10px 10px 60px !important;
    overflow : hidden;
    position : relative;
}

/* ── Card ──────────────────────────────────────────────────── */
.pc-card {
    background    : #fff;
    border        : 1px solid var(--pc-border);
    border-radius : 4px;
    height        : 100%;
    display       : flex;
    flex-direction: column;
    position      : relative;
    overflow      : hidden;
    border-radius : 20px;
    transition    : box-shadow 0.3s cubic-bezier(.25, .46, .45, .94),
                    border-color 0.3s ease;
}

.pc-card:hover {
    box-shadow  : 0 15px 30px rgba(0, 0, 0, .12);
    border-color: transparent;
}

/* ── Badge / ribbon ────────────────────────────────────────── */
.pc-badge {
    position      : absolute;
    top           : 12px;
    left          : -1px;
    background    : var(--pc-primary);
    color         : #fff;
    font-size     : 11px;
    font-weight   : 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding       : 3px 10px 3px 8px;
    z-index       : 3;
    clip-path     : polygon(0 0, 100% 0, calc(100% - 6px) 50%, 100% 100%, 0 100%);
}

/* ── Thumbnail ─────────────────────────────────────────────── */
.pc-thumb {
    position    : relative;
    overflow    : hidden;
    aspect-ratio: 1 / 1;
    background  : #f9f9f9;
}

.pc-thumb img {
    width      : 100%;
    height     : 100%;
    object-fit : contain;
    transition : transform 0.6s ease;
}

.pc-card:hover .pc-thumb img {
    transform: scale(1.08);
}

/* ── Overlay ───────────────────────────────────────────────── */
.pc-overlay {
    position        : absolute;
    inset           : 0;
    background      : rgba(0, 0, 0, .4);
    display         : flex;
    align-items     : center;
    justify-content : center;
    opacity         : 0;
    transition      : opacity 0.3s ease;
    z-index         : 2;
}

.pc-card:hover .pc-overlay {
    opacity: 1;
}

/* ── CTA button ────────────────────────────────────────────── */
.pc-cta {
    background     : var(--pc-primary);
    color          : #fff;
    padding        : 10px 20px;
    text-decoration: none;
    font-weight    : 600;
    font-size      : 13px;
    border-radius  : 4px;
    text-transform : uppercase;
    letter-spacing : .05em;
    white-space    : nowrap;
    transform      : translateY(20px);
    transition     : transform 0.35s ease;
}

.pc-card:hover .pc-cta {
    transform: translateY(0);
}

/* ── Info block ────────────────────────────────────────────── */
.pc-info {
    padding        : 16px 14px;
    text-align     : center;
    flex-grow      : 1;
    display        : flex;
    flex-direction : column;
    justify-content: space-between;
}

.pc-name {
    font-size          : 14px;
    color              : var(--pc-text);
    margin             : 0 0 10px;
    font-weight        : 500;
    line-height        : 1.45;
    text-transform     : lowercase;
    display            : -webkit-box;
    -webkit-line-clamp : 2;
    -webkit-box-orient : vertical;
    overflow           : hidden;
    height             : 41px; /* 2 lines × 14px × 1.45 */
}

.pc-price {
    color      : var(--pc-primary);
    font-weight: 700;
    font-size  : 17px;
    margin     : 0;
    margin-top : auto;
}

/* ── Swiper navigation buttons ─────────────────────────────── */
.pc-nav-next,
.pc-nav-prev {
    color        : #fff !important;
    background   : var(--pc-primary);
    width        : 44px !important;
    height       : 44px !important;
    border-radius: 50%;
    box-shadow   : 0 4px 12px rgba(0, 0, 0, .18);
    transition   : transform 0.2s ease;
}

.pc-nav-next:hover,
.pc-nav-prev:hover {
    transform: scale(1.08);
}

.pc-nav-next::after,
.pc-nav-prev::after {
    font-size  : 17px !important;
    font-weight: 700;
}

/* ── Swiper pagination ─────────────────────────────────────── */
.pc-dots .swiper-pagination-bullet {
    width        : 28px !important;
    height       : 4px !important;
    border-radius: 2px !important;
    background   : #ccc !important;
    opacity      : 1 !important;
    transition   : all 0.3s ease;
}

.pc-dots .swiper-pagination-bullet-active {
    background: var(--pc-primary) !important;
    width     : 48px !important;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .pc-carousel {
        width        : 100%;
        padding-right: 0 !important;
        padding-left : 0 !important;
    }

    .pc-nav-next,
    .pc-nav-prev {
        display: none;
    }
}