/* MBP Plans -- Plugin Stylesheet
   CSS custom properties let partner themes override colors without editing this file.
   Add overrides in the theme stylesheet: .mbpp-grid { --mbpp-primary: #your-color; }
   All selectors namespaced under .mbpp-* to avoid conflicts.
   ------------------------------------------------------------------ */

:root {
    --mbpp-primary:     #42213D;
    --mbpp-accent:      #b8242a;
    --mbpp-text:        #1a1a1a;
    --mbpp-muted:       #666;
    --mbpp-border:      #e2e2e2;
    --mbpp-bg-light:    #f4f4f4;
    --mbpp-bg-white:    #fff;
    --mbpp-radius:      6px;
    --mbpp-radius-sm:   3px;
}

/* Self-contained container -- no dependency on theme's .container class */
.mbpp-container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
}

/* ==========================================================================
   Grid
   ========================================================================== */

.mbpp-grid {
    display: grid;
    grid-template-columns: repeat( 3, 1fr );
    gap: 1.5rem;
    margin: 2rem 0;
    align-items: stretch;
}
@media ( max-width: 900px ) {
    .mbpp-grid { grid-template-columns: repeat( 2, 1fr ); }
}
@media ( max-width: 580px ) {
    .mbpp-grid { grid-template-columns: 1fr; }
}

/* Card */
.mbpp-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var( --mbpp-border );
    border-radius: var( --mbpp-radius );
    overflow: hidden;
    background: var( --mbpp-bg-white );
    box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.06 );
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.mbpp-card:hover {
    box-shadow: 0 6px 20px rgba( 0, 0, 0, 0.12 );
    transform: translateY( -2px );
}

/* Card image */
.mbpp-card__image-link {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var( --mbpp-bg-light );
}
.mbpp-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.mbpp-card:hover .mbpp-card__image {
    transform: scale( 1.03 );
}

/* Card body */
.mbpp-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1rem;
    gap: 0.875rem;
}

/* Title */
.mbpp-card__title {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    color: #1a1a1a;
}
.mbpp-card__title-link {
    color: inherit;
    text-decoration: none;
}
.mbpp-card__title-link:hover,
.mbpp-card__title-link:focus {
    color: var( --mbpp-accent );
    text-decoration: underline;
}

/* Spec pills */
.mbpp-card__specs {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.mbpp-card__specs li {
    font-size: 0.82rem;
    font-weight: 600;
    background: var( --mbpp-bg-light );
    border-radius: var( --mbpp-radius-sm );
    padding: 0.2rem 0.55rem;
    color: #333;
    white-space: nowrap;
}
.mbpp-spec-label {
    font-size: 0.72rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin-right: 0.2rem;
}

/* Description */
.mbpp-card__description {
    font-size: 0.82rem;
    line-height: 1.5;
    color: var( --mbpp-muted );
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* CTA -- full width, always pushed to bottom of card; high specificity to override theme styles */
.mbpp-grid .mbpp-card .mbpp-card__cta {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box;
    text-align: center;
    margin-top: auto;
    padding: 0.65rem 1rem;
    background: #b8242a;
    color: #fff !important;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s ease;
}
.mbpp-grid .mbpp-card .mbpp-card__cta:hover,
.mbpp-grid .mbpp-card .mbpp-card__cta:focus {
    background: #961c21;
    color: #fff !important;
    text-decoration: none;
}

/* Empty state */
.mbpp-empty {
    color: var( --mbpp-muted );
    font-style: italic;
}

/* ==========================================================================
   Detail Page
   ========================================================================== */

/* Breadcrumb -- margin-top is set dynamically via wp_head inline style
   using the mbpp_header_offset option. No hardcoded values here. */
.mbpp-breadcrumb {
    background: var( --mbpp-bg-light );
    padding: 0.6rem 0;
    font-size: 0.82rem;
    border-bottom: 1px solid var( --mbpp-border );
}

.mbpp-breadcrumb__list {
    display: flex;
    gap: 0.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    align-items: center;
}
.mbpp-breadcrumb__list li + li::before {
    content: '/';
    margin-right: 0.4rem;
    color: #aaa;
}
.mbpp-breadcrumb__list a { color: #555; text-decoration: none; }
.mbpp-breadcrumb__list a:hover { color: var( --mbpp-primary ); }

/* H1 title bar */
.mbpp-detail-title-bar {
    background: var( --mbpp-primary );
    padding: 1.25rem 0;
}
.mbpp-detail-h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}
@media ( max-width: 768px ) {
    .mbpp-detail-h1 { font-size: 1.4rem; }
}

/* Hero section */
.mbpp-detail-hero {
    padding: 2rem 0;
    background: var( --mbpp-bg-white );
}
.mbpp-detail-hero__inner {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2.5rem;
    align-items: start;
}
@media ( max-width: 900px ) {
    .mbpp-detail-hero__inner {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Info column */
.mbpp-detail-hero__info {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Primary image */
.mbpp-detail-hero__media { }
.mbpp-detail-hero__primary {
    border-radius: var( --mbpp-radius );
    overflow: hidden;
    background: var( --mbpp-bg-light );
    aspect-ratio: 4 / 3;
}
.mbpp-detail-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.15s ease;
}

/* Gallery strip -- horizontal scroll */
.mbpp-gallery-strip {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    margin-top: 0.75rem;
    -webkit-mask-image: linear-gradient( to right, black 85%, transparent 100% );
    mask-image: linear-gradient( to right, black 85%, transparent 100% );
}
.mbpp-gallery-strip::-webkit-scrollbar { height: 4px; }
.mbpp-gallery-strip::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 2px; }
.mbpp-gallery-strip::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }
.mbpp-gallery-thumb {
    flex: 0 0 auto;
    width: 100px;
    height: 72px;
    scroll-snap-align: start;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: #f4f4f4;
    transition: border-color 0.15s ease;
}
.mbpp-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.mbpp-gallery-thumb:hover,
.mbpp-gallery-thumb.active {
    border-color: #42213D;
}

/* Hero primary image -- magnify hint on hover */
.mbpp-detail-hero__primary {
    position: relative;
    cursor: zoom-in;
}
.mbpp-detail-hero__primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba( 0, 0, 0, 0.14 );
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
}
.mbpp-detail-hero__primary::after {
    content: '\002B\FE0E';
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    width: 34px;
    height: 34px;
    background: rgba( 0, 0, 0, 0.6 );
    color: #fff;
    border-radius: 50%;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 32px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
.mbpp-detail-hero__primary:hover::before,
.mbpp-detail-hero__primary:hover::after {
    opacity: 1;
}

/* Intro content */
.mbpp-intro-content {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e2e2;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #444;
    margin-bottom: 0.75rem;
}

/* What's Included checklist */
.mbpp-includes {
    margin: 0;
}
.mbpp-includes-heading {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #888;
    margin: 0 0 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e2e2;
}
.mbpp-includes-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 1rem !important;
}
.mbpp-includes-list li {
    padding-left: 1.4rem;
    position: relative;
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
    line-height: 1.4;
    color: #444;
}
.mbpp-includes-list li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    top: 0;
    color: #2a7a2a;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Delivery callout */
.mbpp-delivery-callout {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0;
}

/* Specs bar */
.mbpp-detail-specs {
    margin-bottom: 0;
    display: flex;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var( --mbpp-border );
    border-radius: var( --mbpp-radius );
    overflow: hidden;
}
.mbpp-detail-specs li {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0.5rem;
    text-align: center;
    border-right: 1px solid var( --mbpp-border );
}
.mbpp-detail-specs li:last-child { border-right: none; }
.mbpp-detail-specs strong {
    font-size: 1.75rem;
    font-weight: 800;
    color: var( --mbpp-primary );
    line-height: 1;
}
.mbpp-detail-specs span {
    font-size: 0.68rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.25rem;
}

/* Divider */
.mbpp-detail-divider {
    border: none;
    border-top: 1px solid var( --mbpp-border );
    margin: 1.25rem 0;
}

/* Price block */
.mbpp-detail-price { margin-bottom: 0.75rem; }
.mbpp-detail-price__label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
    margin-bottom: 0.2rem;
}
.mbpp-detail-price__amount {
    display: block;
    font-size: 2.4rem;
    font-weight: 800;
    color: var( --mbpp-accent );
    line-height: 1;
    margin-bottom: 0.3rem;
}
.mbpp-detail-price__note {
    font-size: 0.76rem;
    color: #888;
}

/* CTA buttons */
.mbpp-detail-ctas {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.mbpp-btn {
    display: inline-block;
    padding: 0.75rem 1.4rem;
    font-size: 0.88rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    border-radius: var( --mbpp-radius-sm );
    border: 2px solid transparent;
    cursor: pointer;
    line-height: 1.4;
    transition: background 0.2s ease, color 0.2s ease;
}
.mbpp-btn--primary {
    background: var( --mbpp-primary );
    color: #fff !important;
    border-color: var( --mbpp-primary );
}
.mbpp-btn--primary:hover {
    background: #2e1629;
    border-color: #2e1629;
    color: #fff !important;
    text-decoration: none;
}
.mbpp-btn--secondary {
    background: var( --mbpp-accent );
    color: #fff !important;
    border-color: var( --mbpp-accent );
}
.mbpp-btn--secondary:hover {
    background: #961c21;
    border-color: #961c21;
    color: #fff !important;
    text-decoration: none;
}

/* Description + sidebar section */
.mbpp-detail-body {
    padding: 2.5rem 0;
    background: #f9f9f9;
    border-top: 1px solid var( --mbpp-border );
}
.mbpp-detail-body__inner {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2.5rem;
    align-items: start;
}
@media ( max-width: 900px ) {
    .mbpp-detail-body__inner {
        grid-template-columns: 1fr;
    }
}

.mbpp-detail-body h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var( --mbpp-text );
    margin: 0 0 1rem;
}
.mbpp-detail-description {
    font-size: 1rem;
    line-height: 1.8;
    color: #444;
}
.mbpp-detail-description p { margin-bottom: 1rem; }

/* Sidebar */
.mbpp-detail-sidebar {
    background: var( --mbpp-primary );
    color: #fff;
    border-radius: var( --mbpp-radius );
    padding: 1.75rem;
    position: sticky;
    top: 100px;
    align-self: start;
}
.mbpp-detail-sidebar h3 {
    font-size: 1.2rem;
    color: #fff;
    margin: 0 0 0.75rem;
}
.mbpp-detail-sidebar p {
    font-size: 0.88rem;
    line-height: 1.6;
    color: rgba( 255, 255, 255, 0.85 );
    margin-bottom: 1.25rem;
}
.mbpp-detail-sidebar .mbpp-btn--secondary {
    display: block;
    text-align: center;
    margin-bottom: 0.5rem;
}
.mbpp-detail-sidebar .mbpp-btn--outline {
    display: block;
    text-align: center;
    background: transparent;
    color: #fff !important;
    border-color: rgba( 255, 255, 255, 0.5 );
}
.mbpp-detail-sidebar .mbpp-btn--outline:hover {
    background: rgba( 255, 255, 255, 0.12 );
    border-color: #fff;
    color: #fff !important;
    text-decoration: none;
}

/* Back link */
.mbpp-detail-back {
    padding: 1.5rem 0 2rem;
    background: var( --mbpp-bg-white );
    border-top: 1px solid var( --mbpp-border );
}
.mbpp-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var( --mbpp-primary );
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
}
.mbpp-back-link:hover { text-decoration: underline; }

@media ( max-width: 768px ) {
    .mbpp-detail-sidebar { position: static; margin-top: 2rem; }
    .mbpp-detail-ctas    { flex-direction: column; }
}

/* ==========================================================================
   Elementor Compatibility
   ========================================================================== */

.elementor-page .mbpp-detail-hero__inner {
    display: grid !important;
    grid-template-columns: 1.2fr 1fr !important;
}

.elementor-page .mbpp-breadcrumb,
.elementor-page .mbpp-detail-title-bar,
.elementor-page .mbpp-detail-hero,
.elementor-page .mbpp-detail-body,
.elementor-page .mbpp-detail-back {
    width: 100% !important;
    max-width: 100% !important;
}

.elementor-page #content .mbpp-detail-hero .container,
.elementor-page #content .mbpp-detail-body .container {
    padding-left: 20px !important;
    padding-right: 20px !important;
}
