/*
Theme Name: MuscleTech Indonesia Theme
Theme URI: https://muscletech.co.id
Author: Basri
Author URI: https://muscletech.co.id
Description: Fully custom WordPress theme for MuscleTech Indonesia - Official Partner & Distributor.
Version: 1.0.0
Tested up to: 6.5
Requires PHP: 8.0.2
Text Domain: muscletech-theme
*/

/* Ensure the site main layout is always full-width */
html,
body,
#page,
#primary,
.site-main {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure individual sections can be full width */
.home-hero,
section,
footer {
    width: 100% !important;
    max-width: 100% !important;
}

/* Ensure standard container alignment and margins are preserved */
.container {
    width: 100% !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
}

/* Style the View All tag links with hover animations */
.btn-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    font-size: 0.8rem !important;
    letter-spacing: 0.05em !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    transition: all 0.3s ease !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: #111111 !important;
    text-decoration: none !important;
    background: transparent !important;
}

.btn-link:hover {
    background-color: #D91616 !important;
    color: #FFFFFF !important;
    border-color: #D91616 !important;
    transform: translateY(-2px) !important;
}

/* View All tag links in dark containers */
.bg-dark .btn-link {
    color: #FFFFFF !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.bg-dark .btn-link:hover {
    background-color: #D91616 !important;
    color: #FFFFFF !important;
    border-color: #D91616 !important;
}

/* Ensure headings inside dark backgrounds or text-white containers are white */
.bg-dark h1,
.bg-dark h2,
.bg-dark h3,
.bg-dark h4,
.bg-dark h5,
.bg-dark h6,
.text-white h1,
.text-white h2,
.text-white h3,
.text-white h4,
.text-white h5,
.text-white h6 {
    color: #FFFFFF !important;
}

/* Constrain custom logo sizing to prevent header stretch */
.site-branding img,
.site-branding .custom-logo,
.custom-logo-link img {
    max-height: 50px !important;
    width: auto !important;
    max-width: 220px !important;
    object-fit: contain !important;
    display: block !important;
}

/* ============================================
   HEADER LAYOUT — Logo left, Nav center, Actions right
   ============================================ */

.site-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 9999 !important;
}

/* The header-container uses flex with space-between for logo (left) and actions (right).
   The nav is taken out of flow with absolute positioning to sit in the true center. */
.site-header .header-container {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    position: relative !important;
}

/* Center the desktop navigation in the middle of the header */
@media (min-width: 992px) {
    .site-header .main-navigation {
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
    }
}

/* ============================================
   HERO SWIPER FIX
   ============================================ */

/* The hero section had display:flex in inline styles which breaks Swiper's
   internal layout. Override it so the swiper can manage its own flex context. */
.home-hero {
    display: block !important;
    overflow: hidden !important;
}

.home-hero .hero-swiper {
    width: 100% !important;
    overflow: hidden !important;
}

.home-hero .swiper-wrapper {
    display: flex !important;
    align-items: stretch !important;
}

.home-hero .swiper-slide {
    flex-shrink: 0 !important;
    width: 100% !important;
    min-height: 80vh !important;
    display: flex !important;
    align-items: center !important;
    padding: 100px 0 !important;
}

/* ============================================
   HERO SWIPER RESPONSIVE OVERRIDES
   ============================================ */

/* Tablet & Mobile common */
@media (max-width: 991px) {
    .home-hero .swiper-slide {
        min-height: auto !important;
        padding: 60px 0 !important;
    }
    
    .home-hero .hero-container {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
        text-align: center !important;
    }
    
    .home-hero .hero-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .home-hero .hero-title {
        font-size: 4rem !important;
    }
    
    .home-hero .hero-lead {
        margin-left: auto !important;
        margin-right: auto !important;
        font-size: 1.05rem !important;
        margin-bottom: 25px !important;
    }
    
    .home-hero .hero-actions {
        justify-content: center !important;
    }
    
    .home-hero .hero-image-wrapper {
        height: 280px !important;
        margin-top: 10px !important;
    }
    
    .home-hero .hero-product-mockup, 
    .home-hero .hero-product-image-container img {
        max-height: 240px !important;
        width: auto !important;
    }
    
    .home-hero .hero-product-mockup {
        width: 130px !important;
        height: 210px !important;
        font-size: 1.8rem !important;
    }
    
    .home-hero .hero-image-glow {
        width: 240px !important;
        height: 240px !important;
    }
}

/* Mobile specific */
@media (max-width: 575px) {
    .home-hero .swiper-slide {
        padding: 50px 0 !important;
    }
    
    .home-hero .hero-title {
        font-size: 3rem !important;
    }
    
    .home-hero .hero-lead {
        font-size: 0.95rem !important;
    }
    
    .home-hero .hero-image-wrapper {
        height: 220px !important;
    }
    
    .home-hero .hero-product-mockup, 
    .home-hero .hero-product-image-container img {
        max-height: 180px !important;
    }
    
    .home-hero .hero-product-mockup {
        width: 110px !important;
        height: 180px !important;
        font-size: 1.5rem !important;
    }
    
    .home-hero .hero-image-glow {
        width: 180px !important;
        height: 180px !important;
    }
}

/* ============================================
   OFFCANVAS BACKDROP
   ============================================ */

.offcanvas-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: none;
}

.offcanvas-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   MOBILE OFFCANVAS MENU (< 992px)
   ============================================ */

@media (max-width: 991px) {
    .offcanvas-backdrop {
        display: block;
    }

    /* Full-width overlay panel */
    .site-header .main-navigation ul {
        visibility: hidden !important;
        opacity: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        position: fixed !important;
        top: 0 !important;
        right: -100% !important;
        width: 100% !important;
        height: 100vh !important;
        background: #0d0d0d !important;
        z-index: 9999 !important;
        box-shadow: none !important;
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
        padding: 100px 30px 30px !important;
        gap: 10px !important;
        border: none !important;
        margin: 0 !important;
        list-style: none !important;
    }

    .site-header .main-navigation.toggled ul {
        visibility: visible !important;
        opacity: 1 !important;
        right: 0 !important;
    }

    .site-header .main-navigation ul li {
        width: 100% !important;
        text-align: center !important;
    }

    .site-header .main-navigation ul li a {
        display: block !important;
        padding: 14px 0 !important;
        border-bottom: 1px solid #222 !important;
        font-family: 'Teko', sans-serif !important;
        font-size: 1.7rem !important;
        text-transform: uppercase !important;
        letter-spacing: 0.05em !important;
        color: #FFFFFF !important;
        font-weight: 500 !important;
        transition: color 0.3s ease !important;
    }

    .site-header .main-navigation ul li a:hover {
        color: #D91616 !important;
    }

    .site-header .main-navigation .menu-toggle {
        z-index: 10000 !important;
        position: relative !important;
    }

    /* Hide desktop header-actions on mobile */
    .site-header .header-actions {
        display: none !important;
    }
}

/* ============================================
   MOBILE SEARCH (inside offcanvas menu)
   ============================================ */

.mobile-menu-search {
    display: none !important;
}

@media (max-width: 991px) {
    .mobile-menu-search {
        display: block !important;
        width: 100% !important;
    }
}

/* ============================================
   DESKTOP SEARCH INPUT
   ============================================ */

.header-search-container {
    position: relative !important;
}

#header-search-input {
    position: absolute !important;
    right: 36px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 100 !important;
}

/* ============================================
   GOAL CARD PREMIUM INTERACTIONS
   ============================================ */

.goal-card {
    transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.goal-card:hover {
    border-color: #D91616 !important;
    transform: translateY(-6px) !important;
    box-shadow: 0 12px 30px rgba(217, 22, 22, 0.15) !important;
}

.goal-card:hover .goal-icon-wrapper {
    transform: scale(1.1) !important;
    box-shadow: 0 6px 16px rgba(217, 22, 22, 0.3) !important;
}

/* ============================================
   FEATURED PRODUCTS RESPONSIVE SWIPER GRID
   ============================================ */

@media (min-width: 768px) {
    .featured-products-swiper {
        overflow: visible !important;
    }
    .featured-products-swiper .product-grid-wrapper {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 30px !important;
        transform: none !important;
        width: 100% !important;
    }
    .featured-products-swiper .product-slide {
        width: 100% !important;
        height: auto !important;
    }
    .featured-products-swiper .featured-products-pagination {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .featured-products-swiper {
        overflow: hidden !important;
        padding-bottom: 30px !important;
    }
    .featured-products-swiper .product-grid-wrapper {
        display: flex !important;
    }
    .featured-products-swiper .featured-products-pagination {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        text-align: center !important;
    }
    .featured-products-swiper .featured-products-pagination .swiper-pagination-bullet-active {
        background: #D91616 !important;
        opacity: 1 !important;
    }
}

/* ============================================
   BEST SELLERS SWIPER STYLES
   ============================================ */

.best-sellers-swiper {
    overflow: hidden !important;
    padding: 15px 10px 30px 10px !important;
    margin: -15px -10px 0 -10px !important;
}

.best-sellers-swiper .swiper-slide {
    height: auto !important;
    display: flex !important;
}

.best-sellers-swiper .product-card {
    width: 100% !important;
    height: 100% !important;
}

.best-sellers-swiper .best-sellers-pagination .swiper-pagination-bullet-active {
    background: #D91616 !important;
    opacity: 1 !important;
}

/* ============================================
   PRODUCT CARDS EQUAL HEIGHT ALIGNMENT
   ============================================ */

/* Make swiper slides stretch to full height */
.swiper-wrapper {
    display: flex !important;
    align-items: stretch !important;
}

.product-slide,
.swiper-slide {
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Make product cards fill the container and align contents */
.product-card {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
}

/* Let the card details area grow to push the footer block to the absolute bottom */
.product-card-content {
    flex-grow: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
}

/* Constrain internal alignments */
.product-card-footer {
    margin-top: auto !important;
    padding-top: 15px !important;
}

/* ============================================
   PREMIUM SWIPER PAGINATION STYLE
   ============================================ */

.swiper-pagination {
    position: relative !important;
    margin-top: 25px !important;
    bottom: auto !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.swiper-pagination-bullet {
    width: 8px !important;
    height: 8px !important;
    background: rgba(255, 255, 255, 0.4) !important; /* Fallback for dark backgrounds */
    opacity: 1 !important;
    border-radius: 4px !important;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1) !important;
    margin: 0 4px !important;
    border: none !important;
    outline: none !important;
}

/* Bullets in light background sections (Featured, Best Sellers, Related Products, and Instagram) */
.bg-light .swiper-pagination-bullet,
#best-sellers .swiper-pagination-bullet,
.related-products-swiper .swiper-pagination-bullet,
.instagram-swiper .swiper-pagination-bullet {
    background: rgba(0, 0, 0, 0.25) !important;
}

.swiper-pagination-bullet-active {
    background: #D91616 !important;
    opacity: 1 !important;
    width: 22px !important; /* Styled as a modern horizontal pill */
}

/* ============================================
   INSTAGRAM RESPONSIVE SWIPER GRID
   ============================================ */

@media (min-width: 768px) {
    .instagram-swiper {
        overflow: visible !important;
    }
    .instagram-swiper .instagram-grid-wrapper {
        display: grid !important;
        grid-template-columns: repeat(6, 1fr) !important;
        gap: 15px !important;
        transform: none !important;
        width: 100% !important;
    }
    .instagram-swiper .instagram-item {
        width: 100% !important;
        height: auto !important;
    }
    .instagram-swiper .instagram-pagination {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .instagram-swiper {
        overflow: hidden !important;
        padding-bottom: 30px !important;
    }
    .instagram-swiper .instagram-grid-wrapper {
        display: flex !important;
    }
    .instagram-swiper .instagram-pagination {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        text-align: center !important;
    }
    .instagram-swiper .instagram-pagination .swiper-pagination-bullet-active {
        background: #D91616 !important;
        opacity: 1 !important;
    }
}

/* ============================================
   RESPONSIVE TYPOGRAPHY & LAYOUT OVERRIDES (Mobile)
   ============================================ */

/* Hide mobile filter button on desktop */
.mobile-filter-trigger-wrapper {
    display: none !important;
}

@media (max-width: 991px) {
    /* Shop Catalog Grid Stacking */
    .shop-layout {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    /* Show mobile filter trigger button */
    .mobile-filter-trigger-wrapper {
        display: block !important;
    }

    /* Transform shop sidebar into an off-canvas drawer */
    .shop-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -340px !important; /* Start off-screen */
        width: 320px !important;
        height: 100vh !important;
        background: #ffffff !important;
        z-index: 99999 !important;
        overflow-y: auto !important;
        transition: left 0.3s cubic-bezier(0.25, 1, 0.5, 1) !important;
        box-shadow: 0 0 30px rgba(0,0,0,0.15) !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 30px 25px 50px !important;
    }

    .shop-sidebar.active {
        left: 0 !important; /* Slide-in drawer */
    }

    .sidebar-close-wrapper {
        display: flex !important;
    }

    /* Backdrop overlay when filter drawer is open */
    body.filter-open {
        overflow: hidden !important; /* Disable scroll background */
    }

    body.filter-open::after {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 99998;
    }
}

@media (max-width: 767px) {
    /* Section Titles scale down for mobile */
    .section-title, 
    section h2, 
    .home-hero .hero-title,
    #best-sellers h2,
    #featured-products h2,
    #shop-by-goal h2,
    #athletes h2,
    #reviews h2,
    #blog h2,
    #instagram-section h2 {
        font-size: 2.2rem !important;
        line-height: 1 !important;
    }
    
    /* Subtitles / program headers */
    .section-header span,
    .sub-title {
        font-size: 0.8rem !important;
    }

    /* Page Main Headings scale down for mobile */
    .shop-header h1,
    .container header h1,
    .product-info-column h1,
    .athlete-detail-content h1 {
        font-size: 2.5rem !important;
        line-height: 1.1 !important;
    }

    /* CTA Section Header */
    #home-cta h2 {
        font-size: 2.6rem !important;
        line-height: 1.1 !important;
    }
    
    #home-cta p {
        font-size: 1rem !important;
        line-height: 1.5 !important;
        margin-bottom: 25px !important;
    }

    /* Single Post Header / Title */
    .entry-header .entry-title {
        font-size: 2.4rem !important;
        line-height: 1.1 !important;
    }
    
    /* Goal Card Titles */
    .goal-card .goal-title {
        font-size: 1.8rem !important;
    }
    
    /* Athlete Card Titles */
    .athlete-card .athlete-card-name {
        font-size: 1.8rem !important;
    }

    /* Fix product single details grid minmax constraints on small viewports */
    .product-detail-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    /* Prevent swiper container from blowing out layout width */
    .product-gallery {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }
    .product-gallery-main,
    .product-gallery-thumbs,
    .product-gallery-single {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Wrap breadcrumbs on mobile */
    .breadcrumbs {
        flex-wrap: wrap !important;
        line-height: 1.6 !important;
    }

    /* Stack price box on mobile */
    .price-stock-box {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
        padding: 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Ensure product headings break words cleanly */
    .product-info-column h1 {
        font-size: 2.4rem !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }

    /* Stack purchase buttons on mobile for easy tapping */
    .purchase-actions div {
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
    }
    .purchase-actions .btn {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
        display: flex !important;
        box-sizing: border-box !important;
    }

    /* Prevent table layouts from stretching the view width */
    .accordion-panel table {
        width: 100% !important;
        table-layout: fixed !important;
    }
    .accordion-panel td {
        word-wrap: break-word !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }
}

/* ============================================
   RELATED PRODUCTS RESPONSIVE SWIPER GRID
   ============================================ */

@media (min-width: 768px) {
    .related-products-swiper {
        overflow: visible !important;
    }
    .related-products-swiper .related-products-grid-wrapper {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 30px !important;
        transform: none !important;
        width: 100% !important;
    }
    .related-products-swiper .product-slide {
        width: 100% !important;
        height: auto !important;
    }
    .related-products-swiper .related-products-pagination {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .related-products-swiper {
        overflow: hidden !important;
        padding-bottom: 30px !important;
    }
    .related-products-swiper .related-products-grid-wrapper {
        display: flex !important;
    }
    .related-products-swiper .related-products-pagination {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        text-align: center !important;
    }
    .related-products-swiper .related-products-pagination .swiper-pagination-bullet-active {
        background: #D91616 !important;
        opacity: 1 !important;
    }
}

/* ============================================
   ATHLETE PAGES WHITE THEME LAYOUT
   ============================================ */

.post-type-archive-athletes,
.single-athletes {
    background-color: #ffffff !important;
    color: #333333 !important;
}

.post-type-archive-athletes h2,
.post-type-archive-athletes h3,
.post-type-archive-athletes h4,
.single-athletes h2,
.single-athletes h3,
.single-athletes h4,
.single-athletes .typography,
.single-athletes .typography p,
.single-athletes .typography li {
    color: #333333 !important; /* Standard dark grey text */
}

body[class*="athlete"] h1,
body[class*="athlete"] .page-title,
body[class*="athlete"] .entry-title,
.post-type-archive-athletes h1,
.post-type-archive-athletes .page-title,
.single-athletes h1,
.single-athletes .athlete-detail-content h1 {
    color: #D91616 !important; /* Brand red */
}

.post-type-archive-athletes .navigation .page-numbers,
.post-type-archive-athletes .pagination .page-numbers {
    color: #333333 !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
}

.post-type-archive-athletes .navigation .page-numbers:hover,
.post-type-archive-athletes .pagination .page-numbers:hover {
    background: #D91616 !important;
    color: #ffffff !important;
}
.post-type-archive-athletes .navigation .page-numbers.current,
.post-type-archive-athletes .pagination .page-numbers.current {
    background: #111111 !important;
    color: #ffffff !important;
    border-color: #111111 !important;
}

/* Force card content text elements inside dark athlete cards to stay white/red */
.athlete-card .athlete-card-name {
    color: #ffffff !important;
}
.athlete-card .athlete-card-role {
    color: #D91616 !important;
}
.athlete-card .athlete-card-social,
.athlete-card .athlete-card-social span {
    color: #ffffff !important;
    opacity: 0.8 !important;
}

/* Product Variant Informational Tags */
.variant-info-tags {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}

.variant-info-tag {
    display: inline-block !important;
    padding: 6px 14px !important;
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 20px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    font-family: 'Inter', sans-serif !important;
    transition: all 0.2s ease !important;
}

.variant-info-tag:hover {
    border-color: #D91616 !important;
    color: #D91616 !important;
    background: #fff5f5 !important;
}