/*
 * Custom Product Page Styles for Mauka Travels
 * Version: 2.3.0
 * Mobile-first, conversion-optimized design for digital itinerary products
 * 
 * CHANGELOG v2.3.0:
 * - Fixed gallery blank image bug: removed width:100% from .woocommerce-product-gallery__wrapper
 *   (Flexslider needs to set this to e.g. 200% to slide between images; forcing 100% broke image 2+)
 * 
 * CHANGELOG v2.2.0:
 * - Added .product-overlap-notice for hiking guide product overlap warning
 * 
 * CHANGELOG v2.1.1:
 * - Fixed breadcrumb visibility issue by excluding .woocommerce-breadcrumb from nav hiding rule
 * 
 * CHANGELOG v2.1.0:
 * - Fixed heading hierarchy (h1 > h2 > h3)
 * - Improved breadcrumb contrast for WCAG AA
 * - Optimized LCP with image preloading
 * 
 * PERFORMANCE NOTE: For production, consider minifying this file
 * Recommended tool: cssnano or clean-css
 * 
 * SECURITY: All !important flags are documented and necessary for
 * overriding WooCommerce default styles
 */

/* ============================================
   HIDE HEADER & MENU ON PRODUCT PAGES
   ============================================ */

.single-product .site-header,
.single-product header,
.single-product nav:not(.woocommerce-breadcrumb),
.single-product .header,
.single-product #masthead {
    display: none !important;
}

/* Hide footer on product pages */
.single-product .site-footer,
.single-product footer,
.single-product #colophon {
    display: none !important;
}

/* ============================================
   GLOBAL & CONTAINER
   ============================================ */

.woocommerce-page .container,
.single-product .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    background: #fff;
}

/* ============================================
   URGENCY BANNER
   ============================================ */

.urgency-banner {
    background: #70AE6E;
    color: white;
    text-align: center;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
}

/* ============================================
   LAYOUT - MOBILE FIRST
   ============================================ */

.product-wrapper {
    display: flex;
    flex-direction: column;
}

/* Mobile: Title/info comes before images */
.product-images {
    order: 2;
    width: 100%;
    padding: 16px;
}

.product-info {
    order: 1;
    padding: 20px 16px;
}

/* ============================================
   BREADCRUMB
   ============================================ */

.breadcrumb,
.woocommerce-breadcrumb {
    font-size: 14px;
    color: #3E3732; /* Darker for better contrast */
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #F5F0E9;
    border-radius: 6px;
    display: block !important; /* Force show */
    visibility: visible !important;
}

.breadcrumb a,
.woocommerce-breadcrumb a {
    color: #3E3732; /* Darker for WCAG AA contrast */
    text-decoration: underline; /* Always underlined for accessibility */
    text-decoration-color: #ED9B40; /* Orange underline for distinction */
}

.breadcrumb a:hover,
.woocommerce-breadcrumb a:hover {
    color: #ED9B40;
    text-decoration: underline;
}

/* ============================================
   PRODUCT TITLE
   ============================================ */

h1.product-title,
.product_title {
    font-size: 26px;
    font-weight: 700;
    color: #3E3732;
    margin-bottom: 12px;
    line-height: 1.2;
}

/* ============================================
   RATING & BADGES
   ============================================ */

.product-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}

.stars,
.woocommerce-product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stars .star-rating,
.woocommerce-product-rating .star-rating {
    color: #ED9B40;
    font-size: 18px;
}

.review-count {
    color: #3E3732;
    font-weight: 500;
}

.digital-badge {
    background: #70AE6E;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trusted-badge {
    background: #70AE6E; /* Green background so yellow star is visible */
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============================================
   PRICE SECTION
   ============================================ */

.price-section {
    background: #F5F0E9;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 2px solid #ED9B40;
}

.price,
.price-section .woocommerce-Price-amount {
    font-size: 36px;
    font-weight: 700;
    color: #3E3732;
    margin-bottom: 6px;
}

.price-note {
    font-size: 13px;
    color: #554E49;
    margin-bottom: 12px;
}

.value-props {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.value-prop {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #3E3732;
}

.value-icon {
    color: #70AE6E;
    font-size: 16px;
}

/* ============================================
   KEY FEATURES / SHORT DESCRIPTION
   ============================================ */

.key-features-compact {
    margin-bottom: 20px;
}

.key-features-compact h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #3E3732;
}

.features-compact-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.features-compact-list p {
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
}

/* ============================================
   ADD TO CART BUTTON
   ============================================ */

.woocommerce-product-details__add-to-cart {
    margin-bottom: 12px;
}

.single_add_to_cart_button {
    width: 100%;
    background: #ED9B40 !important;
    color: white !important;
    border: none;
    padding: 18px 32px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(237, 155, 64, 0.3);
    transition: all 0.2s;
    margin-bottom: 20px; /* Extra spacing before payment buttons */
}

/* Payment buttons spacing */
.woocommerce-product-details__add-to-cart .payment-buttons,
.woocommerce-product-details__add-to-cart .gpay-button,
.woocommerce-product-details__add-to-cart .apple-pay-button,
.woocommerce-product-details__add-to-cart > div:not(.quantity) {
    margin-top: 16px;
}

.single_add_to_cart_button:hover {
    background: #dc8a30 !important;
    transform: translateY(-1px);
}

.single_add_to_cart_button:active {
    transform: scale(0.98);
}

/* Hide quantity selector for digital products */
.woocommerce-product-details__add-to-cart .quantity {
    display: none;
}

/* ============================================
   INSTANT DOWNLOAD
   ============================================ */

.instant-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #70AE6E;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* ============================================
   TRUST BADGES
   ============================================ */

.trust-badges {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}

.trust-badge {
    text-align: center;
    padding: 12px 8px;
    background: #F5F0E9;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.trust-badge-icon {
    font-size: 22px;
    margin-bottom: 4px;
}

.trust-badge-text {
    font-size: 11px;
    color: #554E49;
    font-weight: 500;
}

/* ============================================
   SOCIAL PROOF HIGHLIGHT
   ============================================ */

.social-proof-highlight {
    background: #F5F0E9;
    border-left: 4px solid #70AE6E;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.proof-quote {
    font-size: 15px;
    font-style: italic;
    color: #3E3732;
    margin-bottom: 8px;
    line-height: 1.5;
}

.proof-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #554E49;
}

.proof-stars {
    color: #ED9B40;
}

/* ============================================
   PRODUCT IMAGES GALLERY - COMPLETE FIX
   ============================================ */

/* Container */
.product-images {
    width: 100%;
    padding: 16px;
}

/* Flexslider Container - CRITICAL FIX */
.product-images .woocommerce-product-gallery {
    width: 100% !important; /* Keep - WooCommerce override */
    margin: 0 !important; /* Keep - WooCommerce override */
}

/* Sliding strip â€” must NOT have width:100% or Flexslider can't slide to image 2+ */
.product-images .woocommerce-product-gallery__wrapper {
    margin: 0 !important; /* Keep - WooCommerce override */
}

/* Main Image Viewport */
.product-images .flex-viewport {
    max-height: 500px !important; /* Keep - Critical fix */
    overflow: hidden !important; /* Keep - Critical fix */
    width: 100% !important; /* Keep - WooCommerce override */
    margin: 0 !important; /* Keep - WooCommerce override */
    height: auto !important; /* Keep - WooCommerce override */
}

/* Main Image */
.product-images .woocommerce-product-gallery__image img,
.product-images .wp-post-image {
    width: 100% !important; /* Keep - Critical fix */
    height: auto !important; /* Keep - Critical fix */
    max-height: 500px !important; /* Keep - Critical fix */
    object-fit: contain !important; /* Keep - Critical fix */
    display: block !important; /* Keep - Critical fix */
    border-radius: 12px;
}

/* Thumbnail Grid */
.product-images .flex-control-thumbs {
    display: grid !important; /* Keep - Override default */
    grid-template-columns: repeat(4, 1fr) !important; /* Keep - Override default */
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    clear: both;
}

.product-images .flex-control-thumbs li {
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
}

/* Thumbnail Images */
.product-images .flex-control-thumbs img {
    width: 100% !important;
    height: 80px !important;
    object-fit: cover !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    border: 2px solid transparent !important;
    transition: all 0.2s ease !important;
    display: block !important;
}

/* Thumbnail Hover & Active States */
.product-images .flex-control-thumbs img:hover,
.product-images .flex-control-thumbs li.flex-active img {
    border-color: #ED9B40 !important;
    opacity: 0.8 !important;
}

/* Desktop: Allow larger images */
@media (min-width: 968px) {
    .product-images .flex-viewport {
        max-height: 700px !important; /* Keep - Critical fix */
    }
    
    .product-images .woocommerce-product-gallery__image img,
    .product-images .wp-post-image {
        max-height: 700px !important; /* Keep - Critical fix */
    }
}

/* ============================================
   WHAT'S INCLUDED SECTION
   ============================================ */

.whats-included {
    background: #F5F0E9;
    padding: 20px 16px;
    margin-bottom: 24px;
}

.whats-included h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #3E3732;
}

.included-grid {
    display: grid;
    gap: 12px;
}

.included-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 8px;
}

.included-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.included-content h3 {
    font-size: 15px;
    font-weight: 600;
    color: #3E3732;
    margin-bottom: 4px;
}

.included-content p {
    font-size: 13px;
    color: #554E49;
    margin: 0;
}

/* ============================================
   GUARANTEE/TRUST SECTION
   ============================================ */

.guarantee-section {
    background: #70AE6E;
    color: white;
    padding: 20px 16px;
    text-align: center;
    margin-bottom: 24px;
}

.guarantee-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.guarantee-section h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.guarantee-section p {
    font-size: 14px;
    opacity: 0.95;
    margin: 0;
}

/* ============================================
   SECONDARY CTA
   ============================================ */

.cta-secondary-wrapper {
    text-align: center;
    padding: 0 16px 32px 16px;
}

.cta-secondary-wrapper .quantity {
    display: none; /* Hide quantity selector in secondary CTA too */
}

.cta-secondary-wrapper .single_add_to_cart_button {
    display: inline-block;
    width: auto;
    background: #70AE6E !important;
    padding: 16px 40px;
    font-size: 17px;
}

.cta-secondary-wrapper .single_add_to_cart_button:hover {
    background: #5f9a5e !important;
}

/* ============================================
   PRODUCT DESCRIPTION (FULL)
   ============================================ */

.product-description-full {
    padding: 32px 16px;
    background: #fff;
}

.product-description-full h2,
.product-description-full h3 {
    color: #3E3732;
    margin-top: 24px;
    margin-bottom: 12px;
}

.product-description-full p {
    font-size: 15px;
    line-height: 1.7;
    color: #554E49;
    margin-bottom: 16px;
}

/* ============================================
   FAQ SECTION - SIMPLE & VISIBLE
   ============================================ */

.faq-section {
    padding: 32px 16px;
    background: #fff;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: #3E3732;
    margin-bottom: 24px;
    text-align: center;
}

.faq-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 20px;
    background: #F5F0E9;
}

.faq-question {
    font-size: 16px;
    font-weight: 600;
    color: #3E3732;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.faq-answer {
    background: transparent;
}

.faq-answer p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #554E49;
}


/* ============================================
   REVIEWS SECTION
   ============================================ */

.reviews-section {
    padding: 32px 16px 80px 16px;
    background: #fff;
}

.review-summary {
    background: #F5F0E9;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    text-align: center;
}

.review-summary-score {
    font-size: 48px;
    font-weight: 700;
    color: #3E3732;
    margin-bottom: 8px;
}

.review-summary-stars {
    color: #ED9B40;
    font-size: 24px;
    margin-bottom: 8px;
}

.review-summary-text {
    font-size: 14px;
    color: #554E49;
}

/* WooCommerce Review Styles */
#reviews .commentlist {
    padding: 0;
    margin: 0;
}

/* Hide the default review title above comments */
#reviews #comments > h2 {
    display: none;
}

/* Show review title only above the form */
#reviews #review_form_wrapper > h2,
#reviews .comment-reply-title {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #3E3732;
    margin-bottom: 20px;
}

#reviews .comment {
    border-bottom: 1px solid #e5e7eb;
    padding: 20px 0;
    list-style: none;
}

#reviews .comment_container {
    display: flex;
    flex-direction: column;
}

#reviews .comment-text {
    margin: 0;
}

#reviews .meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

#reviews .woocommerce-review__author {
    font-weight: 600;
    color: #3E3732;
    margin-bottom: 4px;
}

#reviews .star-rating {
    color: #ED9B40;
    font-size: 14px;
}

#reviews .woocommerce-review__published-date {
    display: none; /* Hide published date */
}

#reviews .description p {
    color: #554E49;
    line-height: 1.6;
    font-size: 14px;
    margin: 0;
}

/* ============================================
   DESKTOP STYLES (min-width: 968px)
   ============================================ */

@media (min-width: 968px) {
    .product-wrapper {
        flex-direction: row;
        gap: 60px;
        padding: 40px;
    }

    .product-images {
        flex: 1;
        position: sticky;
        top: 20px;
        height: fit-content;
        order: 1;
    }

    .product-info {
        flex: 1;
        padding: 20px 0;
        order: 2;
    }

    h1.product-title,
    .product_title {
        font-size: 32px;
    }

    .whats-included {
        padding: 32px 40px;
    }

    .faq-section,
    .reviews-section {
        padding: 48px 40px;
    }

    .trust-badges {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .product-description-full {
        padding: 32px 40px;
    }
}

/* ============================================
   SMALL MOBILE (max-width: 640px)
   ============================================ */

@media (max-width: 640px) {
    .product-images .flex-control-thumbs {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   PRODUCT OVERLAP NOTICE (hiking guide)
   ============================================ */

.product-overlap-notice {
    background: #f0f4f0;
    border: 1px solid #c8dac7;
    border-left: 4px solid #70AE6E;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.product-overlap-notice p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #3E3732;
}

.product-overlap-notice a {
    color: #70AE6E;
    text-decoration: underline;
    font-weight: 600;
}

.product-overlap-notice a:hover {
    color: #5a9458;
}