/**
 * BalticCommerce — Product Detail Page & Catalog Component Styles
 * Slaugita Design System Tokens
 *
 * @package bc-theme
 */

@layer components {
/* ==========================================================================
   1. Single Product Page (PDP)
   ========================================================================== */

.pdp-wrap {
    padding-top: 24px;
    padding-bottom: 64px;
}

.pdp-breadcrumb {
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--gray-accessible);
}

.pdp-breadcrumb-title {
    color: var(--navy);
}

.pdp-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 44px;
    align-items: start;
}

@media (max-width: 1024px) {
    .pdp-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

.pdp-gallery {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pdp-gallery-relative {
    position: relative;
}

.pdp-discount-tag {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 5;
}

.pdp-discount-tag--teal {
    background: var(--teal);
}

.pdp-info {
    display: flex;
    flex-direction: column;
}

.pdp-badges {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.pdp-badge-comp {
    background: var(--green);
    color: var(--white);
    font-size: 12px;
    font-weight: var(--fw-bold);
    padding: 4px 12px;
    border-radius: var(--radius-2xl);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pdp-stock-pill {
    background: var(--green-light);
    color: var(--green);
    font-size: 12.5px;
    font-weight: var(--fw-bold);
    padding: 4px 12px;
    border-radius: var(--radius-2xl);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pdp-stock-pill--out {
    background: var(--red-light);
    color: var(--red);
}

.pdp-title {
    font-size: 26px;
    font-weight: var(--fw-black);
    color: var(--navy);
    line-height: 1.3;
    margin-bottom: 10px;
}

.pdp-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--gray-accessible);
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.pdp-stars {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--amber);
    font-weight: var(--fw-bold);
}

.pdp-reviews-link {
    color: var(--gray-accessible);
    text-decoration: underline;
}

.pdp-brand-link {
    font-weight: var(--fw-bold);
    color: var(--teal-dark);
    text-decoration: none;
}

.pdp-brand-span {
    font-weight: var(--fw-bold);
    color: var(--teal-dark);
}

.pdp-price-box {
    background: var(--bg);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-xl);
    padding: 20px;
    margin-bottom: 24px;
}

.pdp-price-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.pdp-price-new {
    font-size: 32px;
    font-weight: var(--fw-black);
    color: var(--red);
}

.pdp-price-new--navy {
    color: var(--navy);
}

.pdp-price-old {
    font-size: 18px;
    color: var(--gray-accessible);
    text-decoration: line-through;
}

.pdp-savings {
    background: var(--green-light);
    color: var(--green);
    font-size: 13px;
    font-weight: var(--fw-bold);
    padding: 4px 12px;
    border-radius: var(--radius-2xl);
}

.pdp-vat {
    font-size: 12px;
    color: var(--gray-accessible);
    margin-top: 6px;
}

.pdp-size-section {
    margin-bottom: 24px;
}

.pdp-size-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.pdp-size-label {
    font-size: 14px;
    font-weight: var(--fw-bold);
    color: var(--navy);
}

.pdp-size-guide-btn {
    font-size: 12.5px;
    color: var(--teal-dark);
    font-weight: var(--fw-semibold);
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
}

.pdp-size-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pdp-add-row {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.pdp-add-btn-wrap {
    flex: 1;
}

.pdp-phone-banner {
    background: var(--amber-light);
    border: 1.5px solid var(--amber);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    color: var(--navy);
    font-weight: var(--fw-bold);
    font-size: 14px;
    text-decoration: none;
}

.pdp-phone-icon {
    flex-shrink: 0;
}

.pdp-trust-perks {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    border-top: 1px solid var(--line);
    padding-top: 20px;
    text-align: center;
}

.pdp-perk-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--teal-light);
    color: var(--teal-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 6px;
}

.pdp-perk-text {
    font-size: 12.5px;
    font-weight: var(--fw-semibold);
    color: var(--navy);
}

.pdp-tabs {
    margin-top: 56px;
    border-top: 1px solid var(--line);
    padding-top: 40px;
}

.pdp-sticky-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.pdp-sticky-info {
    display: flex;
    flex-direction: column;
}

.pdp-sticky-title {
    font-size: 13.5px;
    font-weight: var(--fw-bold);
    color: var(--navy);
}

.pdp-sticky-price {
    font-size: 16px;
    font-weight: var(--fw-black);
    color: var(--red);
}

.pdp-sticky-form {
    margin: 0;
}

.pdp-sticky-btn {
    height: 44px;
    padding: 0 22px;
    font-size: 14px;
    border-radius: var(--radius-lg);
}


/* ==========================================================================
   2. Product Gallery / Images
   ========================================================================== */

.bc-single-product .woocommerce-product-gallery,
.pdp-gallery-container {
    opacity: 1;
    overflow: hidden;
    box-sizing: border-box;
}

.pdp-main-image-wrap {
    position: relative;
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-2xl);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    cursor: zoom-in;
}

.pdp-main-img {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    transition: transform 0.15s ease-out;
}

.pdp-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.pdp-thumb {
    width: 70px;
    height: 70px;
    border: 2px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--white);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.pdp-thumb.active {
    border-color: var(--teal);
}

.pdp-thumb-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}


/* ==========================================================================
   3. Related Products & Cards
   ========================================================================== */

.pdp-related-section {
    margin-top: 48px;
    border-top: 1px solid var(--line);
    padding-top: 36px;
}

.pdp-related-heading {
    font-size: 22px;
    font-weight: var(--fw-black);
    color: var(--navy);
    margin-bottom: 24px;
}

.pdp-related-grid {
    list-style: none;
    padding: 0;
    margin: 0;
}

.p-card-badge-comp {
    position: static;
}

.p-card-discount-teal {
    background: var(--teal);
}

.p-card-price-navy {
    color: var(--navy);
}


/* ==========================================================================
   4. Archive / Catalog Page
   ========================================================================== */

.cat-header {
    margin-top: 12px;
}

.cat-filter-title {
    font-size: 18px;
    font-weight: var(--fw-black);
    color: var(--navy);
    margin: 0;
}

.cat-filter-group {
    margin-top: 16px;
}

.cat-filter-group-bordered {
    margin-top: 16px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.cat-filter-subhead {
    font-size: 12px;
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 10px;
}

.cat-filter-scroll-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}

.cat-filter-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--ink);
    cursor: pointer;
    min-height: 44px;
    padding: 4px 0;
}

.cat-filter-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--teal);
    flex-shrink: 0;
}

.cat-filter-count {
    margin-left: auto;
    font-size: 12px;
    color: var(--count-text);
    font-weight: var(--fw-medium);
}

.cat-filter-price-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.cat-filter-price-input {
    width: 100%;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    padding: 0 8px;
    font-size: 14px;
    background: var(--white);
    color: var(--ink);
}

.cat-filter-price-dash {
    color: var(--gray);
}

.cat-filter-cat-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
}

.cat-filter-cat-link {
    color: var(--ink);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 40px;
    padding: 4px 0;
    font-size: 14px;
    text-decoration: none;
}

.cat-filter-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cat-filter-btn-apply {
    width: 100%;
    height: 48px;
    font-weight: var(--fw-bold);
}

.cat-filter-btn-clear {
    width: 100%;
    height: 44px;
    font-weight: var(--fw-semibold);
    border: 1px solid var(--line);
    background: transparent;
    color: var(--navy);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.cat-toolbar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.cat-active-filters-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.cat-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cat-results-count {
    font-size: 14px;
    font-weight: var(--fw-semibold);
    color: var(--gray-accessible);
}

.cat-pagination-row {
    margin-top: 32px;
    display: flex;
    justify-content: center;
}

/* Catalog layout: stable grid, responsive controls, and zero image layout shift. */
.bc-catalog {
    padding-bottom: var(--space-16);
}

.bc-catalog__layout {
    gap: var(--space-6);
}

.bc-catalog__sidebar {
    width: min(var(--catalog-sidebar-width), 100%);
}

.bc-catalog__toolbar {
    min-height: var(--touch-target-min);
}

.woocommerce ul.products.bc-catalog__grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
    margin: 0;
}

.woocommerce ul.products.bc-catalog__grid::before,
.woocommerce ul.products.bc-catalog__grid::after {
    content: none !important;
    display: none !important;
}

.woocommerce ul.products.bc-catalog__grid li.product {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
}

.bc-catalog-card {
    min-width: 0;
    contain: layout paint style;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.bc-catalog-card__image {
    aspect-ratio: 1;
    height: auto;
    overflow: hidden;
    flex-shrink: 0;
}

.bc-catalog-card .bc-catalog-card__image-element {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.bc-catalog-card__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.bc-catalog-card .product-info h3 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    min-height: 2.4em;
    font-size: 0.84375rem;
    line-height: 1.25;
    margin-bottom: 0.25rem;
}

.bc-catalog-card:focus-within {
    box-shadow: 0 0 0 var(--focus-outline-width) var(--teal-light), var(--shadow-md);
}

.bc-catalog-card a:focus-visible,
.bc-catalog-card button:focus-visible,
.bc-catalog__sidebar input:focus-visible,
.bc-catalog__sidebar a:focus-visible,
.bc-mobile-filter-trigger:focus-visible {
    outline: var(--focus-outline-width) solid var(--teal);
    outline-offset: var(--space-1);
}

@media (min-width: 40rem) {
    .woocommerce ul.products.bc-catalog__grid {
        gap: var(--space-4);
    }
}

@media (min-width: 64.0625rem) {
    .woocommerce ul.products.bc-catalog__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--space-5);
    }
}

@media (min-width: 80rem) {
    .woocommerce ul.products.bc-catalog__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 64rem) {
    .bc-catalog__sidebar {
        width: min(var(--catalog-sidebar-mobile-width), 88vw);
    }
}

@media (max-width: 30rem) {
    .bc-catalog {
        padding-bottom: calc(var(--space-16) + var(--touch-target-min));
    }

    .bc-catalog__toolbar {
        align-items: stretch;
    }

    .bc-catalog__toolbar > div,
    .bc-catalog__toolbar .woocommerce-ordering,
    .bc-catalog__toolbar .woocommerce-ordering select {
        width: 100%;
    }

    .bc-catalog-card .delivery-line,
    .bc-catalog-card .stars__count,
    .bc-catalog-card .savings-tag {
        display: none;
    }
}

/* Product decision area — calm hierarchy around price and purchase. */
.bc-single-product .pdp-grid {
    gap: var(--space-12);
}

.bc-single-product .woocommerce-product-gallery,
.pdp-gallery-container {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-2xl);
    background: linear-gradient(145deg, var(--bg), var(--teal-light));
    padding: 16px;
    box-sizing: border-box;
}

.bc-single-product .woocommerce-product-gallery__wrapper {
    aspect-ratio: 1;
}

.bc-single-product .pdp-info {
    padding: var(--space-6);
    border: 1px solid var(--line);
    border-radius: var(--radius-2xl);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.bc-single-product .pdp-title {
    font-size: clamp(var(--fs-2xl), 3vw, var(--fs-4xl));
    letter-spacing: -0.035em;
}

.bc-single-product .pdp-meta {
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--line);
}

.bc-single-product .pdp-price-box {
    padding: var(--space-6);
    border-color: var(--teal);
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--bg), var(--teal-light));
}

.bc-single-product .pdp-add-row {
    padding-top: var(--space-2);
}

.bc-single-product .pdp-add-btn-wrap .single_add_to_cart_button {
    min-height: 3.5rem;
    border-radius: var(--radius-lg);
    background: var(--teal) !important;
    color: #ffffff !important;
    font-weight: var(--fw-bold);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.bc-single-product .pdp-add-btn-wrap .single_add_to_cart_button:hover {
    background: var(--teal-dark) !important;
    box-shadow: 0 6px 18px rgba(13, 144, 142, 0.35);
}

.bc-single-product .pdp-add-btn-wrap form.cart {
    display: flex !important;
    width: 100%;
    align-items: stretch !important;
    gap: var(--space-3) !important;
}

.bc-single-product .pdp-add-btn-wrap .qty {
    height: 3.5rem !important;
    margin: 0 !important;
    border-color: var(--teal) !important;
    border-radius: var(--radius-lg) !important;
}

.bc-single-product .pdp-add-btn-wrap .qty .qty-btn {
    width: var(--touch-target-min) !important;
    background: var(--teal-light) !important;
    color: var(--teal-dark) !important;
}

.bc-single-product .pdp-add-btn-wrap .qty .qty-btn:hover,
.bc-single-product .pdp-add-btn-wrap .qty .qty-btn:focus-visible {
    background: var(--teal) !important;
    color: var(--white) !important;
}

.bc-single-product .pdp-add-btn-wrap .qty input.qty {
    width: var(--touch-target-min) !important;
    color: var(--navy) !important;
}

.bc-single-product .pdp-add-btn-wrap .single_add_to_cart_button {
    flex: 1 1 12rem !important;
    min-height: 3.5rem !important;
    height: auto !important;
    background: var(--teal) !important;
    color: var(--white) !important;
    box-shadow: var(--shadow-sm);
}

.bc-single-product .pdp-add-btn-wrap .single_add_to_cart_button:hover,
.bc-single-product .pdp-add-btn-wrap .single_add_to_cart_button:focus-visible {
    background: var(--teal-dark) !important;
    box-shadow: 0 6px 18px rgba(13, 144, 142, 0.35);
}

.bc-single-product .pdp-phone-banner {
    border-radius: var(--radius-lg);
}

.bc-single-product .pdp-trust-perks {
    padding-top: var(--space-5);
    border-top: 1px solid var(--line);
}

.bc-single-product .pdp-tabs {
    margin-top: var(--space-16);
}

@media (max-width: 64rem) {
    .bc-single-product .pdp-grid {
        gap: var(--space-6);
    }

    .bc-single-product .pdp-info {
        padding: var(--space-5);
    }
}

@media (max-width: 30rem) {
    .bc-single-product .pdp-breadcrumb {
        margin-bottom: var(--space-2);
        font-size: var(--fs-xs);
    }

    .bc-single-product .pdp-grid {
        gap: var(--space-3);
    }

    .bc-single-product .pdp-main-image-wrap,
    .bc-single-product .woocommerce-product-gallery__wrapper,
    .bc-single-product .woocommerce-product-gallery img {
        max-height: 260px;
    }

    .bc-single-product .pdp-info {
        padding: var(--space-3);
    }

    .bc-single-product .pdp-title {
        font-size: 1.25rem;
        line-height: 1.25;
        margin-bottom: var(--space-2);
    }

    .bc-single-product .pdp-price-box {
        padding: var(--space-3);
        margin-bottom: var(--space-2);
    }

    .bc-single-product .pdp-add-btn-wrap .single_add_to_cart_button {
        min-height: 3rem !important;
    }

    .bc-single-product .pdp-trust-perks {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }
}

@media (prefers-reduced-motion: reduce) {
    .bc-catalog-card,
    .bc-catalog-card .product-img img,
    .bc-catalog-card .pulse-dot {
        animation: none;
        transition: none;
    }
}

/* Clean, simple catalog header */
.bc-catalog__intro {
    position: relative;
    display: block !important;
    margin-top: var(--space-3);
    margin-bottom: var(--space-6);
    padding: 0 0 var(--space-4) 0 !important;
    border: none !important;
    border-bottom: 1px solid var(--line) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.bc-catalog__intro-content {
    position: relative;
    max-width: 100%;
}

.bc-catalog__eyebrow,
.bc-catalog__intro-mark {
    display: none !important;
}

.bc-catalog__title {
    max-width: 100%;
    margin: 0;
    color: var(--navy);
    font-size: clamp(1.375rem, 2.5vw, 1.875rem) !important;
    font-weight: 800;
    line-height: var(--lh-tight);
}

.bc-catalog__description {
    max-width: 48rem;
    margin-top: var(--space-2);
    color: var(--gray-accessible);
    font-size: var(--fs-sm);
    line-height: var(--lh-relaxed);
}

.bc-catalog__description .term-description {
    margin: 0;
}
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bc-catalog__layout {
    align-items: stretch;
}

.bc-catalog__sidebar {
    align-self: start;
    border-radius: var(--radius-xl);
    box-shadow: none;
}

.bc-catalog__filter-header {
    margin-bottom: var(--space-2);
}

.bc-catalog__toolbar {
    padding: var(--space-3) 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.bc-catalog__result-summary {
    color: var(--gray-accessible);
}

.bc-catalog__sort .orderby {
    min-height: var(--touch-target-min);
    padding-inline: var(--space-4);
    border-radius: var(--radius-full);
    background: var(--bg);
    color: var(--navy);
    font-weight: var(--fw-semibold);
}

.bc-catalog__active-filters {
    min-height: var(--space-8);
}

.bc-catalog-card {
    border-radius: var(--radius-xl);
    box-shadow: none;
}

.bc-catalog-card:hover {
    border-color: var(--teal);
    box-shadow: var(--shadow-md);
}

.bc-catalog-card .product-img {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: var(--bg-muted, #f8fafc);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
}

.bc-catalog-card .product-img img,
.bc-catalog-card__image-element {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.bc-catalog-card .product-info {
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.bc-catalog-card .stock-status-pill {
    margin-bottom: var(--space-2);
}

.bc-catalog-card .price-row {
    margin-top: auto;
    padding-top: var(--space-2);
    border-top: 1px solid var(--line);
}

.bc-catalog-card .btn-add {
    border-radius: var(--radius-lg);
    background: var(--teal);
    color: #ffffff;
}

.bc-catalog-card .btn-add:hover {
    background: var(--teal-dark);
    color: #ffffff;
}

@media (max-width: 64rem) {
    .bc-catalog__intro {
        margin-bottom: var(--space-6);
    }
}

@media (max-width: 48rem) {
    .bc-catalog__intro {
        align-items: start;
        min-height: 0;
        padding: var(--space-6);
    }

    .bc-catalog__intro-mark {
        width: 6rem;
        min-width: 6rem;
    }

    .bc-catalog__intro-mark-line {
        width: var(--space-6);
        height: var(--space-6);
    }

    .bc-catalog__intro-mark-copy {
        display: none;
    }

    .bc-catalog__sort,
    .bc-catalog__sort .woocommerce-ordering,
    .bc-catalog__sort .orderby {
        width: 100%;
    }
}

@media (max-width: 30rem) {
    .bc-catalog__intro {
        display: block;
        padding: var(--space-5);
    }

    .bc-catalog__intro-mark {
        display: none;
    }

    .bc-catalog-card .product-img,
    .bc-catalog-card .product-info {
        padding: var(--space-3);
    }

    .bc-catalog-card .stock-status-pill {
        margin-bottom: var(--space-2);
    }
}
}
