/**
 * Yeap Reseller Store Fixes — reseller-store-fixes.css
 *
 * All overrides are scoped to .yrsf-* selectors or tightly-qualified
 * rstore-* selectors so no other pages are affected.
 *
 * Requirements addressed:
 *  Req 1  — Carousel banner reuses theme .hero-carousel structure & styling.
 *  Req 2  — Category title visibility.
 *  Req 3  — Product title colour + professional hover.
 *  Req 4  — Product detail image/banner below the fixed .fifa-navbar (70 px).
 *  Req 5  — Product card layout: spacing, description wrap, bullet lists,
 *            price & cart button spacing. Both Basic + Pro display consistently.
 *  Req 6  — Responsive: desktop centred & professional, mobile no overlap.
 *
 * Loads after: yeapnews-style, yeapnews-carousel, navbar-carousel-fix,
 *              carousel-spacing (all registered by the theme).
 */


/* ═══════════════════════════════════════════════════════════════════════════
   REQ 1 — CAROUSEL BANNER
   The banner now uses the EXACT same HTML structure as the WooCommerce
   category carousel (.category-carousel-wrapper > .category-carousel), so
   woocommerce.css and navbar-carousel-fix.css already provide:
     - .category-carousel .carousel-item img → height: 400px, object-fit:cover
     - .category-carousel .carousel-caption  → full-width, bottom, centred h2+p
     - .category-carousel-wrapper            → 100vw, correct positioning
   This section only adds the gradient placeholder for when no image is set.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Gradient placeholder when no thumbnail image has been uploaded.
   Height matches .category-carousel .carousel-item img (woocommerce.css:1202) */
.yrsf-banner-placeholder {
    width: 100%;
    height: 400px;
    background: linear-gradient(
        135deg,
        var(--primary-color, #0072c6) 0%,
        var(--secondary-color, #00306e) 100%
    );
    display: block;
}


/* ═══════════════════════════════════════════════════════════════════════════
   REQ 2 — CATEGORY TITLE VISIBILITY
   ═══════════════════════════════════════════════════════════════════════════ */

/* Wrapper that sits immediately below the carousel banner */
.yrsf-category-page {
    padding-top: 40px;
    padding-bottom: 60px;
}

/* Category title — uses theme heading scale; contrasts against the
   .content-section-bg background (white/light grey) */
.yrsf-cat-header {
    text-align: center;
    margin-bottom: 36px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--primary-color, #0072c6);
}

/* REQ 2: Title clearly visible — dark on the light content background */
.yrsf-cat-title {
    color: var(--heading-color, #1a1a2e) !important;
    font-size: clamp(1.8rem, 3.5vw, 2.6rem) !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px !important;
    line-height: 1.2 !important;
}

/* Make the category description below the title readable */
.yrsf-cat-desc {
    color: #555 !important;
    font-size: 1.05rem !important;
    max-width: 700px;
    margin: 0 auto !important;
    line-height: 1.6 !important;
}


/* ═══════════════════════════════════════════════════════════════════════════
   REQ 3 — PRODUCT TITLE COLOUR + HOVER
   ═══════════════════════════════════════════════════════════════════════════ */

/* Product title inside cards */
.yrsf-product-title {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    margin-bottom: 8px !important;
    line-height: 1.3 !important;
}

/* REQ 3: Crisp dark colour that works on both light-card and dark-card backgrounds */
.yrsf-product-link,
.yrsf-product-link:visited {
    color: var(--heading-color, #1a1a2e) !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

/* REQ 3: Professional hover — uses theme's primary colour */
.yrsf-product-link:hover,
.yrsf-product-link:focus {
    color: var(--primary-color, #0072c6) !important;
    text-decoration: underline !important;
}

/* Single product page title */
.yrsf-product-detail-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem) !important;
    font-weight: 800 !important;
    color: var(--heading-color, #1a1a2e) !important;
    margin-bottom: 16px !important;
    line-height: 1.25 !important;
}


/* ═══════════════════════════════════════════════════════════════════════════
   REQ 4 — PRODUCT DETAIL IMAGE / BANNER BELOW FIXED NAVBAR
   The .category-carousel-wrapper mirrors the WooCommerce category carousel
   structure, so the same navbar clearance rules from woocommerce.css and
   navbar-carousel-fix.css apply automatically. No extra rules needed here.

   The content below the banner still needs breathing room:
   ═══════════════════════════════════════════════════════════════════════════ */

.yrsf-single-product-page {
    padding-top: 36px;
    padding-bottom: 60px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   REQ 5 — PRODUCT CARD LAYOUT (category listing)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Product grid gutter */
.yrsf-product-grid {
    row-gap: 24px;
}

/* Individual product card */
.yrsf-product-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.yrsf-product-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
    transform: translateY(-3px);
}

/* Icon area at top of card */
.yrsf-product-icon-link {
    display: block;
    text-decoration: none !important;
    background: #f7f9fc;
    padding: 24px;
    text-align: center;
    border-bottom: 1px solid #eef0f3;
}

/* REQ 5: Product icons/SVGs from GoDaddy — standardise size */
.yrsf-product-icon.rstore-product-icons svg,
.yrsf-product-icon .rstore-product-icons svg {
    width: 80px !important;
    height: 80px !important;
    display: block !important;
    margin: 0 auto !important;
}

.yrsf-product-icon img.yrsf-product-thumb {
    max-width: 100px;
    max-height: 80px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Card body */
.yrsf-product-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* REQ 5: Description — prevent one long unbroken line */
.yrsf-product-excerpt {
    color: #555 !important;
    font-size: 0.9rem !important;
    line-height: 1.55 !important;
    /* Allow natural word-wrapping */
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
    white-space: normal !important;
    margin-bottom: 14px !important;
    flex: 1; /* push price + button to bottom of card */
}

/* REQ 5: Price with proper spacing */
.yrsf-product-pricing {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #eef0f3;
    margin-bottom: 14px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.yrsf-price,
.yrsf-price-sale {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: var(--primary-color, #0072c6) !important;
}

.yrsf-price-retail {
    font-size: 1rem !important;
    font-weight: 400 !important;
    color: #aaa !important;
    text-decoration: line-through !important;
}

/* REQ 5: Actions area — Add to Cart + View Details */
.yrsf-product-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

/* Override GoDaddy's add-to-cart form spacing */
.yrsf-product-actions .rstore-add-to-cart-form {
    margin: 0 !important;
    padding: 0 !important;
}

/* Add-to-cart button inherits theme .btn .btn-primary styling;
   also force button text to white (theme's button-colors.php override) */
.yrsf-product-actions .rstore-add-to-cart.btn {
    width: 100% !important;
    padding: 10px 16px !important;
    font-size: 0.95rem !important;
    color: #ffffff !important;
}

/* "View Details" text link */
.yrsf-details-link {
    text-align: center;
    font-size: 0.85rem;
    color: var(--primary-color, #0072c6) !important;
    text-decoration: none !important;
}
.yrsf-details-link:hover {
    text-decoration: underline !important;
}

/* Pagination */
.yrsf-pagination {
    margin-top: 40px;
    text-align: center;
}
.yrsf-pagination .page-numbers {
    display: inline-block;
    padding: 6px 14px;
    margin: 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: var(--primary-color, #0072c6);
    text-decoration: none;
}
.yrsf-pagination .page-numbers.current,
.yrsf-pagination .page-numbers:hover {
    background: var(--primary-color, #0072c6);
    color: #fff !important;
    border-color: var(--primary-color, #0072c6);
}


/* ═══════════════════════════════════════════════════════════════════════════
   REQ 5 — PRODUCT DETAIL LAYOUT (single product page)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Breadcrumb back-link */
.yrsf-breadcrumb {
    margin-bottom: 24px;
}
.yrsf-back-link {
    color: var(--primary-color, #0072c6) !important;
    font-size: 0.9rem;
    text-decoration: none !important;
}
.yrsf-back-link:hover {
    text-decoration: underline !important;
}

/* Detail row */
.yrsf-product-detail-row {
    align-items: flex-start;
    row-gap: 28px;
}

/* Icon column */
.yrsf-product-detail-icon-col {
    text-align: center;
}

/* REQ 5: Icon / image — standardise size on detail page */
.yrsf-product-detail-icon.rstore-product-icons svg,
.yrsf-product-detail-icon .rstore-product-icons svg {
    width: 160px !important;
    height: 160px !important;
    display: block !important;
    margin: 0 auto !important;
}

.yrsf-product-detail-icon img {
    max-width: 240px;
    max-height: 200px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* REQ 5: Pricing on detail page */
.yrsf-product-detail-pricing {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--primary-color, #0072c6);
}

.yrsf-product-detail-pricing .yrsf-price,
.yrsf-product-detail-pricing .yrsf-price-sale {
    font-size: 1.6rem !important;
    font-weight: 700 !important;
    color: var(--primary-color, #0072c6) !important;
}

.yrsf-product-detail-pricing .yrsf-price-retail {
    font-size: 1.1rem !important;
    color: #aaa !important;
    text-decoration: line-through !important;
}

.yrsf-product-detail-pricing .yrsf-price-term {
    font-size: 0.95rem !important;
    color: #666 !important;
}

/* REQ 5: Cart form area — space between price and button */
.yrsf-product-detail-actions {
    margin-bottom: 28px;
}

.yrsf-product-detail-actions .rstore-add-to-cart-form {
    margin: 0 !important;
    padding: 0 !important;
}

.yrsf-product-detail-actions .rstore-add-to-cart.btn {
    padding: 12px 32px !important;
    font-size: 1rem !important;
    min-width: 180px !important;
    color: #ffffff !important;
}

/* REQ 5: Description section — wrap, paragraph spacing, bullet points */
.yrsf-product-description {
    color: #333 !important;
    line-height: 1.7 !important;
    font-size: 1rem !important;
}

/* Ensure paragraphs have vertical spacing */
.yrsf-product-description p {
    margin-bottom: 14px !important;
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
    white-space: normal !important;
}

/* REQ 5: Feature lists — convert dash-lists to styled bullets */
.yrsf-product-description ul,
.yrsf-feature-list {
    list-style: disc !important;
    padding-left: 1.5em !important;
    margin-bottom: 14px !important;
}

.yrsf-product-description ul li,
.yrsf-feature-list li {
    margin-bottom: 6px !important;
    line-height: 1.55 !important;
    color: #333 !important;
    /* Never collapses to a single unbroken line */
    white-space: normal !important;
    overflow-wrap: break-word !important;
}

/* Make any rstore-price / rstore-retail-price inside the description consistent */
.yrsf-product-description .rstore-pricing {
    margin-top: 16px !important;
    padding-top: 12px !important;
    border-top: 1px solid #eef0f3 !important;
}

/* Space between description and appended GoDaddy cart form (if rendered inline) */
.yrsf-product-description .rstore-add-to-cart-form {
    margin-top: 20px !important;
}


/* ═══════════════════════════════════════════════════════════════════════════
   GLOBAL RSTORE OVERRIDES (apply on all pages where GoDaddy CSS loads)
   Scoped to rstore classes so they only affect reseller products.
   ═══════════════════════════════════════════════════════════════════════════ */

/* REQ 3: Ensure rstore widget titles are readable */
.rstore-product-header .widget-title {
    color: var(--heading-color, #1a1a2e) !important;
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    margin-bottom: 8px !important;
}

/* REQ 5: Prevent rstore pricing from collapsing to a single line */
.rstore-pricing {
    font-size: 1rem !important;
    display: block !important;
    margin-top: 8px !important;
    margin-bottom: 12px !important;
}

/* REQ 5: rstore add-to-cart button text always white */
.rstore-add-to-cart.btn,
.rstore-add-to-cart.button {
    color: #ffffff !important;
}

/* REQ 5: rstore product summary — allow word-wrap */
.rstore-product-summary {
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
}

/* REQ 5: rstore product icons standard sizing in widgets */
.rstore-product-icons svg {
    width: 8rem !important;
    display: block !important;
    margin: 0 auto 12px !important;
}


/* ═══════════════════════════════════════════════════════════════════════════
   REQ 6 — RESPONSIVE OVERRIDES
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tablet (768 px – 1024 px) ─────────────────────────────────────────── */
@media (max-width: 1024px) and (min-width: 769px) {

    /* REQ 1: Banner */
    .yrsf-banner .homepage-carousel-caption.yrsf-caption {
        max-width: 85% !important;
        padding: 18px 22px !important;
    }

    /* REQ 5: Icon column full width → sits above details on narrow tablets */
    .yrsf-product-detail-icon-col {
        margin-bottom: 16px;
    }

    .yrsf-product-detail-icon.rstore-product-icons svg {
        width: 120px !important;
        height: 120px !important;
    }
}

/* ── Mobile (≤ 768 px) ─────────────────────────────────────────────────── */
@media (max-width: 768px) {

    /* REQ 1: Banner placeholder — shorter on mobile to match img rule */
    .yrsf-banner-placeholder {
        height: 220px !important;
    }

    /* REQ 2: Category title smaller on mobile */
    .yrsf-cat-title {
        font-size: 1.5rem !important;
    }

    /* REQ 4: Detail page: single column stacked layout */
    .yrsf-product-detail-row {
        flex-direction: column;
    }

    .yrsf-product-detail-icon-col {
        margin-bottom: 20px;
    }

    .yrsf-product-detail-icon.rstore-product-icons svg {
        width: 100px !important;
        height: 100px !important;
    }

    /* REQ 5: Cart button full-width on mobile */
    .yrsf-product-detail-actions .rstore-add-to-cart.btn {
        width: 100% !important;
        min-width: unset !important;
    }

    /* REQ 5: Card actions stacked on mobile */
    .yrsf-product-actions .rstore-add-to-cart.btn {
        font-size: 0.9rem !important;
    }

    /* REQ 6: Product grid — single column on small phones */
    .yrsf-product-grid .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ── Small phones (< 480 px) ───────────────────────────────────────────── */
@media (max-width: 480px) {

    .yrsf-category-page {
        padding-top: 24px;
    }

    .yrsf-cat-header {
        margin-bottom: 24px;
    }

    .yrsf-product-card-body {
        padding: 14px;
    }

    .yrsf-single-product-page {
        padding-top: 20px;
    }

    .yrsf-product-detail-title {
        font-size: 1.35rem !important;
    }

    .yrsf-product-detail-pricing .yrsf-price,
    .yrsf-product-detail-pricing .yrsf-price-sale {
        font-size: 1.3rem !important;
    }
}
