/*
Theme Name: Divi Child - AMS Fans
Theme URI: https://amsfansdev.fig1.com
Description: Child theme for AMS Fans site. Contains only CSS that Divi 5 cannot handle through its builder.
Author: AMS Fans
Version: 3.3.10
Template: Divi
*/


/* Prevent horizontal scroll — Divi section overflow should be set in builder */
body, #page-container {
    overflow-x: hidden;
}

/* ==========================================================================
   AMS TOP BAR - Custom red bar above nav (phone left, CTA + search + cart right)
   ========================================================================== */

/* Make top bar fixed above header */
#ams-top-bar {
    background: #B50B00;
    color: #ffffff;
    font-size: 14px;
    padding: 4px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100000;
}

/* Push top bar + header below WP admin bar when logged in (only when bar is present) */
body.admin-bar.ams-has-top-bar #ams-top-bar {
    top: 32px;
}
body.admin-bar.ams-has-top-bar #main-header {
    top: 66px !important;
}
@media (max-width: 782px) {
    body.admin-bar.ams-has-top-bar #ams-top-bar {
        top: 46px;
    }
    body.admin-bar.ams-has-top-bar #main-header {
        top: 80px !important;
    }
}

/* Push main header down when top bar is visible */
body.ams-has-top-bar #main-header {
    top: 34px !important;
}
/* Page content needs to clear the top bar height */
body.ams-has-top-bar #page-container {
    padding-top: 34px !important;
}
body.ams-has-top-bar.et_fixed_nav.et_show_nav #page-container {
    padding-top: 114px !important;
}
body.et-tb #main-header,
body.et-tb-has-header #main-header {
    top: 40px !important;
}
#ams-top-bar .container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
}
.ams-top-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.ams-top-bar-left {
    display: flex;
    align-items: center;
}
.ams-top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Phone number */
.ams-top-phone {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ffffff !important;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}
.ams-top-phone:hover {
    opacity: 0.85;
    color: #ffffff !important;
}
.ams-top-phone svg {
    flex-shrink: 0;
}

/* Talk to an Expert button */
.ams-top-cta {
    background: #ffffff;
    color: #B50B00 !important;
    padding: 4px 14px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    line-height: 1.6;
}
.ams-top-cta:hover {
    background: #191919;
    color: #ffffff !important;
}

/* Search + cart icons */
.ams-top-search,
.ams-top-cart {
    color: #ffffff !important;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s;
    position: relative;
}
.ams-top-search:hover,
.ams-top-cart:hover {
    opacity: 0.85;
    color: #ffffff !important;
}
.ams-top-cart-count,
.ams-top-cart .ams-cart-badge {
    background: #ffffff;
    color: #B50B00;
    font-size: 10px;
    font-weight: 700;
    padding: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-left: -6px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    line-height: 1;
    position: absolute;
    top: -6px;
    right: -8px;
}
.ams-top-cart {
    position: relative;
}

/* Hide default Divi search + cart in primary nav (moved to top bar) */
#et-top-navigation #et_top_search,
#et-top-navigation .et-cart-info {
    display: none !important;
}

/* Hide Divi's default secondary nav if it still renders */
#top-header {
    display: none !important;
}

/* Mobile: collapse the top bar */
/* Hide top-bar search icon when hamburger is active (search is inside mobile menu) */
@media (max-width: 1199px) {
    .ams-top-search {
        display: none !important;
    }
}

@media (max-width: 768px) {
    #ams-top-bar {
        padding: 6px 0;
        font-size: 13px;
    }
    .ams-top-bar-right {
        gap: 10px;
    }
    .ams-top-cta {
        padding: 5px 10px;
        font-size: 11px;
    }
    .ams-top-phone svg {
        display: none;
    }
}


/* ==========================================================================
   MOBILE NAV BREAKPOINT — Switch to hamburger at 1200px instead of 980px
   Divi has no setting to change the mobile breakpoint.
   ========================================================================== */
@media (min-width: 981px) and (max-width: 1199px) {
    #top-menu-nav,
    nav#top-menu-nav { display: none !important; }

    #et_mobile_nav_menu { display: block !important; }
    .mobile_nav { display: block !important; }
    .mobile_nav .mobile_menu_bar {
        display: block !important;
        position: relative;
        cursor: pointer;
        padding: 4px 0;
    }
    .mobile_nav .mobile_menu_bar:before {
        content: '\61';
        font-family: 'ETmodules' !important;
        font-size: 32px;
        color: #191919;
        line-height: 1;
    }

    #et-top-navigation {
        display: flex !important;
        align-items: center;
        gap: 16px;
    }

    .et_mobile_menu {
        background: #fff;
        z-index: 9999;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        border-top: 1px solid #e0e0e0;
    }

    #et_top_search,
    .et-cart-info { display: inline-block !important; }
}

/* ==========================================================================
   DIVI 5 BETA GAPS — CSS that Divi 5 beta doesn't generate from its modules
   ========================================================================== */

/* Button module wrapper — D5 beta sets display:inline-block on wrappers but
   generates text-align:center in page CSS expecting block-level wrappers. */
.et_pb_button_module_wrapper {
    display: block !important;
}

/* Waypoint animations — D5 modules have et-waypoint class but don't trigger
   the animation JS, so content stays invisible at opacity:0 */
.et-waypoint:not(.et_pb_counters),
.et_pb_section.et-waypoint,
.et_pb_row.et-waypoint,
.et_pb_column.et-waypoint,
.et_pb_module.et-waypoint {
    opacity: 1 !important;
}

/* Accordion/toggle — D5 beta renders the HTML structure but doesn't
   generate any of the toggle styling or open/close behavior */
.et_pb_accordion .et_pb_toggle {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
    background: #ffffff;
}
.et_pb_toggle .et_pb_toggle_title {
    cursor: pointer;
    background: transparent;
    padding: 14px 45px 14px 18px;
    font-size: 16px;
    font-weight: 600;
    color: #191919;
    position: relative;
    margin: 0;
    line-height: 1.4;
}
.et_pb_toggle .et_pb_toggle_title::after {
    content: "+";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    font-weight: 400;
    color: #B50B00;
    line-height: 1;
}
.et_pb_toggle .et_pb_toggle_title::before {
    display: none !important;
}
.et_pb_toggle_open .et_pb_toggle_title::after {
    content: "\2212";
}
.et_pb_toggle .et_pb_toggle_title:hover {
    background: rgba(0,0,0,0.03);
}
.et_pb_toggle_close .et_pb_toggle_content {
    display: none;
}
.et_pb_toggle_open .et_pb_toggle_content {
    display: block;
    padding: 15px 18px;
}
.et_pb_toggle .et_pb_toggle_content p {
    margin-bottom: 10px;
    line-height: 1.6;
}
.et_pb_toggle .et_pb_toggle_content p:last-child {
    margin-bottom: 0;
}


/* ==========================================================================
   PAGE LAYOUT — WordPress structural fix (not controllable in Divi)
   ========================================================================== */

/* Hide duplicate page title — WordPress renders entry-title above Divi sections */
body.page .entry-title,
body.page article > .entry-title,
body.page h1.entry-title,
body.page .entry-title.main_title,
body.page h1.main_title,
body.page.wp-singular .entry-title,
body.page.wp-singular h1.entry-title,
body.page.wp-singular .entry-title.main_title,
body.page .et_full_width_page .entry-title,
.page-template-default .entry-title,
body.home .entry-title,
body.home h1.entry-title,
body.home .et_post_meta_wrapper > h1,
.home #main-content .container h1.entry-title,
.home #left-area h1.entry-title {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
    position: absolute !important;
    clip: rect(0,0,0,0) !important;
}


/* ==========================================================================
   COMPONENTS — Divi module fixes that have no builder setting
   ========================================================================== */

/* Hide empty social icons in footer */
.et-social-icons a[href="#"] {
    display: none;
}



/* Product hover — remove Divi's blue overlay, add subtle zoom */
.woocommerce ul.products li.product a img {
    transition: transform 0.3s ease;
}
.woocommerce ul.products li.product a:hover img {
    transform: scale(1.05);
}
.woocommerce ul.products li.product .et_overlay,
.et_overlay {
    display: none !important;
}

/* Footer email - prevent line break */
#footer-widgets .widget a[href*="mailto"] {
    word-break: break-all;
    font-size: 0.85em;
}


/* ==========================================================================
   BLOG — Standard WordPress post styling (not Divi builder pages)
   These posts use WP default template, not Divi modules.
   ========================================================================== */

/* Blog post images — float right with text wrap */
body.single-post .entry-content img,
body.single-post article .post-body img {
    max-width: 400px;
    width: auto;
    height: auto;
    float: right;
    margin: 0 0 20px 25px;
    border-radius: 8px;
}
@media (max-width: 768px) {
    body.single-post .entry-content img,
    body.single-post article .post-body img {
        max-width: 100%;
        float: none;
        margin: 15px 0;
    }
}
body.single-post .entry-content::after {
    content: "";
    display: table;
    clear: both;
}

/* Blog post FAQ accordion (aria-controls pattern — custom HTML, not Divi module) */
body.single-post [aria-controls] {
    cursor: pointer;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 40px 12px 15px;
    width: 100%;
    text-align: left;
    font-size: 16px;
    font-weight: 600;
    color: #191919;
    position: relative;
    margin-bottom: 5px;
}
body.single-post [aria-controls]::after {
    content: "+";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    font-weight: 400;
    color: #B50B00;
}
body.single-post [aria-controls][aria-expanded="true"]::after {
    content: "\2212";
}
body.single-post [aria-controls]:hover {
    background: #f0f0f0;
}
body.single-post .accordion-panel-hidden {
    display: none;
}

/* Related Articles cards (custom HTML from functions.php) */
#related-articles {
    clear: both;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}
#related-articles h2 {
    margin: 0 0 20px;
    color: #191919;
    font-size: 24px;
    font-weight: 700;
}
#related-articles .row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
#related-articles .row > div {
    flex: 1 1 calc(33.333% - 14px);
    max-width: calc(33.333% - 14px);
    display: flex;
}
#related-articles .card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex: 1;
}
#related-articles .card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
    height: 100%;
}
#related-articles .card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
#related-articles .card img {
    float: none;
    max-width: 100%;
    width: 100%;
    height: auto;
    margin: 0;
    border-radius: 0;
    aspect-ratio: 3/2;
    object-fit: cover;
}
#related-articles .card-body {
    padding: 15px;
    display: block;
    flex: 1;
}
#related-articles .card-body .h6 {
    font-size: 16px;
    font-weight: 600;
    color: #191919;
    line-height: 1.4;
}
#related-articles .card-link:hover .h6 {
    color: #B50B00;
}
@media (max-width: 991px) {
    #related-articles .d-none { display: none; }
    #related-articles .row > div:first-child {
        flex: 1 1 100%;
        max-width: 100%;
    }
}
@media (min-width: 992px) {
    #related-articles .d-lg-block { display: block; }
}


/* ==========================================================================
   PRODUCT FEATURES & SPECS — Custom HTML from functions.php (not Divi modules)
   ========================================================================== */

.ams-product-details {
    display: flex;
    gap: 40px;
    margin: 30px 0;
    flex-wrap: wrap;
}
.ams-features {
    flex: 1 1 55%;
    min-width: 300px;
}
.ams-specs {
    flex: 1 1 35%;
    min-width: 280px;
}
.ams-feature {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: flex-start;
}
.ams-feature-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
}
.ams-feature-icon img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}
.ams-feature-text h4 {
    margin: 0 0 6px 0;
    font-size: 17px;
    font-weight: 700;
    color: #191919;
    line-height: 1.3;
}
.ams-feature-text p {
    margin: 0;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}
.ams-specs h4 {
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 700;
    color: #191919;
}
.ams-specs-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ams-specs-list li {
    padding: 10px 0;
    border-bottom: 1px solid #e8e8e8;
    font-size: 14px;
    line-height: 1.5;
    color: #444;
    list-style: none;
}
.ams-specs-list li::before,
.ams-specs-list li::marker {
    content: none;
    display: none;
}
.ams-specs-list li strong {
    color: #191919;
    font-weight: 600;
}
@media (max-width: 768px) {
    .ams-product-details {
        flex-direction: column;
        gap: 24px;
    }
    .ams-features,
    .ams-specs {
        flex: 1 1 100%;
        min-width: 0;
    }
}


/* ==========================================================================
   WOOCOMMERCE PRODUCT GRID — Image sizing for shop/category pages
   WooCommerce product loops don't have Divi module settings.
   ========================================================================== */

ul.products li.product a img,
.woocommerce ul.products li.product a img {
    width: 100%;
    height: 280px;
    object-fit: contain;
    background: #ffffff;
}
ul.products li.product,
.woocommerce ul.products li.product {
    text-align: center;
}


/* ==========================================================================
   FOOTER — Custom watermark (no Divi setting for pseudo-element backgrounds)
   ========================================================================== */

#main-footer {
    position: relative;
    overflow: hidden;
}
#main-footer::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -25%;
    transform: translateY(-50%);
    width: 45%;
    height: 140%;
    background: url('/wp-content/uploads/ams-logo-mark-white.svg') no-repeat center center;
    background-size: contain;
    opacity: 0.07;
    pointer-events: none;
    z-index: 1;
}
#main-footer > .container {
    position: relative;
    z-index: 2;
}
#footer-widgets .footer-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
#footer-widgets .footer-widget ul li {
    list-style: none;
    padding: 3px 0;
    margin: 0;
}
#footer-widgets .footer-widget ul li::before,
#footer-widgets .footer-widget ul li::marker {
    content: none;
    display: none;
}


/* ==========================================================================
   CATEGORY PAGE CONTENT — Custom HTML from functions.php (not Divi modules)
   ========================================================================== */

.ams-category-content {
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 0 20px;
}
.ams-cat-section {
    padding: 50px 0;
    border-bottom: 1px solid #e0e0e0;
}
.ams-cat-section:last-child {
    border-bottom: none;
}
.ams-cat-section h2 {
    font-size: 28px;
    font-weight: 700;
    color: #191919;
    margin: 0 0 20px;
    line-height: 1.3;
}
.ams-cat-section p {
    font-size: 16px;
    line-height: 1.7;
    color: #444;
    margin-bottom: 15px;
}
.ams-cat-section p:last-child {
    margin-bottom: 0;
}
.ams-cat-row {
    display: flex;
    gap: 40px;
    align-items: center;
}
.ams-cat-col {
    flex: 1 1 50%;
    min-width: 0;
}
.ams-cat-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}
.ams-cat-section ul {
    list-style: none;
    padding: 0;
    margin: 15px 0 0;
}
.ams-cat-section ul li {
    padding: 6px 0 6px 20px;
    position: relative;
    font-size: 15px;
    line-height: 1.6;
    color: #444;
    list-style: none;
}
.ams-cat-section ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    width: 8px;
    height: 8px;
    background: #B50B00;
    border-radius: 50%;
}
.ams-cat-section.ams-full-width p {
    max-width: 900px;
}
.ams-cat-section.ams-full-width .ams-two-col-text {
    display: flex;
    gap: 40px;
}
.ams-cat-section.ams-full-width .ams-two-col-text > div {
    flex: 1 1 50%;
}
.ams-cat-cta {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    padding: 80px 40px;
    text-align: center;
    border-radius: 8px;
    margin: 50px 0;
}
.ams-cat-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(25, 25, 25, 0.75);
    border-radius: 8px;
}
.ams-cat-cta > * {
    position: relative;
    z-index: 1;
}
.ams-cat-cta h2 {
    color: #ffffff;
    font-size: 32px;
    margin-bottom: 15px;
}
.ams-cat-cta p {
    color: #e0e0e0;
    font-size: 18px;
    max-width: 700px;
    margin: 0 auto 25px;
}
.ams-cat-cta .ams-cta-btn {
    display: inline-block;
    background: #B50B00;
    color: #ffffff;
    padding: 14px 32px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease;
}
.ams-cat-cta .ams-cta-btn:hover {
    background: #8f0900;
    color: #ffffff;
}
.ams-cat-video-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}
.ams-cat-video-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}
.ams-faq-section {
    padding: 50px 0;
}
.ams-faq-section h2 {
    font-size: 28px;
    font-weight: 700;
    color: #191919;
    margin: 0 0 25px;
}
.ams-faq-item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
    background: #ffffff;
}
.ams-faq-question {
    cursor: pointer;
    background: #f8f9fa;
    padding: 14px 45px 14px 18px;
    font-size: 16px;
    font-weight: 600;
    color: #191919;
    position: relative;
    margin: 0;
    line-height: 1.4;
}
.ams-faq-question::after {
    content: "+";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    font-weight: 400;
    color: #B50B00;
    line-height: 1;
}
.ams-faq-open .ams-faq-question::after {
    content: "\2212";
}
.ams-faq-question:hover {
    background: #f0f0f0;
}
.ams-faq-answer {
    display: none;
    padding: 15px 18px;
    font-size: 15px;
    line-height: 1.7;
    color: #444;
}
.ams-faq-open .ams-faq-answer {
    display: block;
}
.ams-faq-answer p {
    margin-bottom: 10px;
}
.ams-faq-answer p:last-child {
    margin-bottom: 0;
}
.ams-cat-blogs {
    padding: 50px 0 0;
}
.ams-cat-blogs h3 {
    font-size: 24px;
    font-weight: 700;
    color: #191919;
    margin: 0 0 20px;
}
.ams-cat-blogs .ams-blog-grid {
    display: flex;
    gap: 20px;
}
.ams-cat-blogs .ams-blog-card {
    flex: 1 1 calc(33.333% - 14px);
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s ease;
}
.ams-cat-blogs .ams-blog-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.ams-cat-blogs .ams-blog-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 3/2;
    object-fit: cover;
}
.ams-cat-blogs .ams-blog-card .ams-blog-card-body {
    padding: 15px;
}
.ams-cat-blogs .ams-blog-card .ams-blog-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #191919;
    line-height: 1.4;
}
.ams-cat-blogs .ams-blog-card:hover .ams-blog-card-title {
    color: #B50B00;
}
.ams-cat-blogs .ams-view-all {
    display: inline-block;
    margin-top: 50px;
    color: #B50B00;
    font-weight: 600;
    text-decoration: none;
}
.ams-cat-blogs .ams-view-all:hover {
    color: #191919;
}

/* Recent Posts shortcode grid ([ams_recent_posts]) */
.ams-recent-posts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.ams-post-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease;
}
.ams-post-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.ams-post-card .ams-post-thumb img {
    width: 100%;
    height: auto;
    aspect-ratio: 3/2;
    object-fit: cover;
    display: block;
}
.ams-post-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.ams-post-card h4 {
    margin: 0 0 10px;
    font-size: 16px;
    line-height: 1.4;
}
.ams-post-card h4 a {
    color: #191919;
    text-decoration: none;
}
.ams-post-card h4 a:hover {
    color: #B50B00;
}
.ams-post-card p {
    color: #666666;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 15px;
    flex: 1;
}
.ams-read-more {
    display: inline-block;
    background: #B50B00;
    color: #ffffff;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease;
    align-self: flex-start;
}
.ams-read-more:hover {
    background: #8f0900;
    color: #ffffff;
}
@media (max-width: 768px) {
    .ams-recent-posts {
        grid-template-columns: 1fr;
    }
}

/* Responsive: category content */
@media (max-width: 768px) {
    .ams-cat-row {
        flex-direction: column;
        gap: 25px;
    }
    .ams-cat-col {
        flex: 1 1 100%;
    }
    .ams-cat-section h2 {
        font-size: 24px;
    }
    .ams-cat-cta {
        padding: 50px 20px;
    }
    .ams-cat-cta h2 {
        font-size: 26px;
    }
    .ams-cat-section.ams-full-width .ams-two-col-text {
        flex-direction: column;
        gap: 0;
    }
    .ams-cat-blogs .ams-blog-grid {
        flex-direction: column;
    }
    .ams-cat-blogs .ams-blog-card {
        flex: 1 1 100%;
    }
}


/* ==========================================================================
   FOOTER MOBILE — Add spacing between stacked widget columns
   ========================================================================== */

@media (max-width: 980px) {
    #footer-widgets .footer-widget {
        margin-bottom: 30px;
        padding-bottom: 25px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    #footer-widgets .footer-widget:last-child {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }
}


/* ==========================================================================
   WOOCOMMERCE CART — WC Block styling (no Divi module settings for these)
   ========================================================================== */

body.woocommerce-cart .ams-page-title,
body.woocommerce-checkout .ams-page-title {
    background: #191919;
    padding: 40px 0;
    text-align: center;
    margin-bottom: 40px;
}
body.woocommerce-cart .ams-page-title h1,
body.woocommerce-checkout .ams-page-title h1 {
    color: #ffffff;
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

body.woocommerce-cart.et_full_width_page #page-container #left-area,
body.woocommerce-cart #page-container #main-content #left-area {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 30px 60px !important;
    width: 100% !important;
    float: none !important;
}

.wc-block-cart .wc-block-cart-items th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #666;
    font-weight: 600;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 12px;
}
.wc-block-cart .wc-block-cart-items .wc-block-cart-items__row {
    border-bottom: 1px solid #f0f0f0;
    padding: 20px 0;
}
.wc-block-cart .wc-block-cart-items .wc-block-cart-items__row:last-child {
    border-bottom: 1px solid #e0e0e0;
}
.wc-block-cart .wc-block-cart-items .wc-block-components-product-name {
    font-weight: 600;
    color: #191919;
    text-decoration: none;
    font-size: 16px;
}
.wc-block-cart .wc-block-cart-items .wc-block-components-product-name:hover {
    color: #B50B00;
}
.wc-block-components-quantity-selector {
    border: 1px solid #d0d0d0 !important;
    border-radius: 6px !important;
    overflow: hidden;
}
.wc-block-components-quantity-selector input {
    font-weight: 600;
}
.wc-block-cart .wc-block-cart__sidebar {
    background: #fafafa;
    border-radius: 8px;
    padding: 24px;
    border: 1px solid #e8e8e8;
}
.wc-block-cart .wc-block-cart__sidebar .wc-block-components-totals-wrapper {
    border-color: #e8e8e8;
}
.wc-block-cart .wc-block-cart__submit-button,
.wc-block-cart .wc-block-components-checkout-step .wc-block-components-button,
.wc-block-cart .wp-block-woocommerce-proceed-to-checkout-block a,
.wc-block-cart .wc-block-cart__submit-container a {
    background-color: #B50B00 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    padding: 14px 24px !important;
    text-transform: none !important;
    transition: background-color 0.2s ease !important;
}
.wc-block-cart .wc-block-cart__submit-button:hover,
.wc-block-cart .wp-block-woocommerce-proceed-to-checkout-block a:hover,
.wc-block-cart .wc-block-cart__submit-container a:hover {
    background-color: #8f0900 !important;
}
.wc-block-cart .wc-block-cart__empty-cart__title {
    font-size: 24px;
    font-weight: 600;
    color: #191919;
}


/* ==========================================================================
   WOOCOMMERCE CHECKOUT — WC Block styling (no Divi module settings)
   ========================================================================== */

body.woocommerce-checkout.et_full_width_page #page-container #left-area,
body.woocommerce-checkout #page-container #main-content #left-area {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 30px 60px !important;
    width: 100% !important;
    float: none !important;
}
.wc-block-checkout .wp-block-woocommerce-checkout-fields-block {
    padding-right: 40px;
}
.wc-block-checkout .wc-block-components-checkout-step__heading {
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #191919 !important;
    margin-bottom: 16px !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
}
.wc-block-checkout .wc-block-components-checkout-step__title {
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #191919 !important;
}
.wc-block-checkout .wc-block-components-text-input input,
.wc-block-checkout .wc-block-components-text-input textarea,
.wc-block-checkout .wc-block-components-combobox .components-combobox-control input,
.wc-block-checkout select,
.wc-block-checkout .wc-block-components-country-input select,
.wc-block-checkout .wc-block-components-state-input select {
    border: 1px solid #d0d0d0 !important;
    border-radius: 8px !important;
    padding: 12px 14px !important;
    font-size: 15px !important;
    transition: border-color 0.15s ease !important;
    background: #ffffff !important;
    color: #191919 !important;
}
.wc-block-checkout .wc-block-components-text-input input:focus,
.wc-block-checkout .wc-block-components-text-input textarea:focus,
.wc-block-checkout .wc-block-components-combobox .components-combobox-control input:focus,
.wc-block-checkout select:focus {
    border-color: #191919 !important;
    outline: none !important;
    box-shadow: 0 0 0 1px #191919 !important;
}
.wc-block-checkout .wc-block-components-text-input label {
    color: #888 !important;
    font-size: 14px !important;
}
.wc-block-checkout .wc-block-components-text-input.is-active label {
    color: #555 !important;
    font-size: 10px !important;
    top: 2px !important;
    line-height: 1.2 !important;
}
.wc-block-checkout .wc-blocks-components-select__container {
    position: relative !important;
}
.wc-block-checkout .wc-blocks-components-select__label {
    font-size: 10px !important;
    top: 2px !important;
    left: 14px !important;
    color: #888 !important;
    pointer-events: none;
    line-height: 1.2 !important;
}
.wc-block-checkout .wc-block-components-country-input .wc-blocks-components-select__select,
.wc-block-checkout .wc-block-components-state-input .wc-blocks-components-select__select,
.wc-block-checkout .wc-blocks-components-select__container .wc-blocks-components-select__select {
    padding-top: 18px !important;
    padding-bottom: 6px !important;
    height: 50px !important;
}
.wc-block-checkout .wc-block-components-checkout-step {
    margin-bottom: 24px !important;
    padding-bottom: 24px !important;
    border-bottom: 1px solid #eee !important;
}
.wc-block-checkout .wc-block-components-checkout-step:last-child {
    border-bottom: none !important;
}
.wc-block-checkout fieldset legend,
.wc-block-checkout fieldset .wc-block-components-checkout-step__heading {
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #191919 !important;
    padding-bottom: 12px !important;
    margin-bottom: 20px !important;
    width: 100%;
}
.wc-block-checkout .wp-block-woocommerce-checkout-order-summary-block {
    background: #fafafa !important;
    border-radius: 10px !important;
    padding: 28px !important;
    border: 1px solid #e8e8e8 !important;
    position: sticky;
    top: 100px;
}
.wc-block-checkout .wc-block-components-order-summary .wc-block-components-order-summary__button-text,
.wc-block-checkout .wp-block-woocommerce-checkout-order-summary-block > .wc-block-components-totals-wrapper:first-child {
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #191919 !important;
}
.wc-block-checkout .wc-block-components-order-summary-item {
    padding: 16px 0 !important;
    border-bottom: 1px solid #eee !important;
}
.wc-block-checkout .wc-block-components-order-summary-item__image {
    border-radius: 8px !important;
    border: 1px solid #e8e8e8 !important;
    overflow: hidden;
    min-width: 48px !important;
    width: 48px !important;
    height: 48px !important;
    flex-shrink: 0 !important;
}
.wc-block-checkout .wc-block-components-order-summary-item__image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}
.wc-block-checkout .wc-block-components-order-summary-item__description .wc-block-components-product-name {
    font-weight: 600 !important;
    color: #191919 !important;
    font-size: 14px !important;
    text-decoration: none !important;
}
.wc-block-checkout .wc-block-components-totals-wrapper {
    border-color: #e8e8e8 !important;
}
.wc-block-checkout .wc-block-components-totals-item .wc-block-components-totals-item__label {
    font-size: 14px !important;
    color: #555 !important;
}
.wc-block-checkout .wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #191919 !important;
}
.wc-block-checkout .wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #191919 !important;
}
.wc-block-checkout .wc-block-components-checkout-place-order-button,
.wc-block-checkout .wc-block-checkout__actions_row .wc-block-components-button {
    background-color: #B50B00 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 17px !important;
    padding: 16px 32px !important;
    text-transform: none !important;
    width: 100%;
    transition: background-color 0.2s ease !important;
    letter-spacing: 0 !important;
}
.wc-block-checkout .wc-block-components-checkout-place-order-button:hover,
.wc-block-checkout .wc-block-checkout__actions_row .wc-block-components-button:hover {
    background-color: #8f0900 !important;
}
.wc-block-checkout .wc-block-components-checkout-return-to-cart-button,
.wc-block-checkout .wc-block-checkout__actions_row a {
    color: #555 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}
.wc-block-checkout .wc-block-components-checkout-return-to-cart-button:hover,
.wc-block-checkout .wc-block-checkout__actions_row a:hover {
    color: #B50B00 !important;
}
.wc-block-checkout .wc-block-components-totals-coupon,
.wc-block-cart .wc-block-components-totals-coupon {
    border-color: #e8e8e8 !important;
}
.wc-block-checkout .wc-block-components-totals-coupon__button,
.wc-block-cart .wc-block-components-totals-coupon__button {
    background-color: #191919 !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
}
.wc-block-checkout .wc-block-components-radio-control__option {
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    padding: 16px !important;
    margin-bottom: 8px !important;
}
.wc-block-checkout .wc-block-components-radio-control__option--checked {
    border-color: #191919 !important;
    background: #fafafa !important;
}
.wc-block-checkout .wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"]:checked {
    background-color: #B50B00 !important;
    border-color: #B50B00 !important;
}
.wc-block-checkout .wc-block-components-notice-banner.is-error,
.wc-block-cart .wc-block-components-notice-banner.is-error {
    border-left: 4px solid #B50B00 !important;
    border-radius: 6px !important;
    background: #fef2f2 !important;
}
.wc-block-checkout .wc-block-checkout__terms a {
    color: #B50B00 !important;
}
.wc-block-checkout .wc-block-checkout__terms a:hover {
    color: #191919 !important;
}

/* Responsive cart/checkout */
@media (max-width: 768px) {
    body.woocommerce-cart #main-content .container,
    body.woocommerce-checkout #main-content .container {
        padding: 0 16px 40px !important;
    }
    body.woocommerce-cart .ams-page-title,
    body.woocommerce-checkout .ams-page-title {
        padding: 30px 0;
        margin-bottom: 24px;
    }
    body.woocommerce-cart .ams-page-title h1,
    body.woocommerce-checkout .ams-page-title h1 {
        font-size: 26px;
    }
    .wc-block-checkout .wp-block-woocommerce-checkout-fields-block {
        padding-right: 0;
    }
    .wc-block-checkout .wp-block-woocommerce-checkout-order-summary-block {
        position: static;
        margin-top: 24px;
    }
}


/* ==========================================================================
   SEARCH RESULTS — Custom search template (not a Divi module)
   ========================================================================== */

.ams-product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.ams-product-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}
.ams-product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.ams-product-card a {
    text-decoration: none;
    color: inherit;
    display: block;
    padding: 16px;
    text-align: center;
}
.ams-product-image {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.ams-product-image img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
}
.ams-product-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #191919;
    margin: 0 0 8px;
    line-height: 1.3;
}
.ams-product-price {
    color: #B50B00;
    font-weight: 600;
    font-size: 0.9rem;
}
.ams-content-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}
.ams-content-card {
    display: flex;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}
.ams-content-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.ams-content-thumb {
    flex-shrink: 0;
    width: 180px;
}
.ams-content-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ams-content-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.ams-content-type {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #B50B00;
    margin-bottom: 6px;
}
.ams-content-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 8px;
    line-height: 1.3;
}
.ams-content-info h3 a {
    color: #191919;
    text-decoration: none;
}
.ams-content-info h3 a:hover {
    color: #B50B00;
}
.ams-content-info p {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.5;
    margin: 0;
}
@media (max-width: 768px) {
    .ams-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .ams-content-grid {
        grid-template-columns: 1fr;
    }
    .ams-content-thumb {
        width: 120px;
    }
}
@media (max-width: 480px) {
    .ams-product-grid {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================================
   SINGLE PRODUCT — Variation labels + dropdowns alignment
   ========================================================================== */

.single-product .variations th.label,
.single-product .variations td.value,
.woocommerce div.product form.cart .variations td,
.woocommerce div.product form.cart .variations th {
    vertical-align: middle !important;
    padding: 10px 10px 10px 0 !important;
}
.single-product .variations th.label {
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}
/* Single custom arrow on variation select (beats WooCommerce core + Divi specificity) */
.woocommerce.single-product div.product form.cart .variations td.value select,
.woocommerce.single-product div.product form.cart .variations td select {
    width: 100% !important;
    min-width: 200px;
    padding: 8px 32px 8px 12px !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-color: #ececec !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23666' d='M1 1l5 5 5-5'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 12px 8px !important;
}
/* Hide the legacy Divi 4 span:after arrow in case the module wraps select in a span */
.woocommerce div.product form.cart .variations td.value span:after,
.et_pb_wc_add_to_cart form.cart .variations td.value span:after {
    display: none !important;
}


/* ==========================================================================
   SINGLE PRODUCT — Review submit button hover
   Divi's Reviews module exposes the base button styles but not hover
   ========================================================================== */
.single-product #review_form #submit:hover,
.single-product #commentform #submit:hover,
.single-product form.comment-form button[type="submit"]:hover,
.single-product form.comment-form input[type="submit"]:hover {
    background-color: #8f0900 !important;
    color: #ffffff !important;
    border-color: #8f0900 !important;
    opacity: 1 !important;
}


/* ==========================================================================
   SINGLE PRODUCT — Add to cart button
   ========================================================================== */

.woocommerce.single-product div.product form.cart,
.woocommerce div.product form.cart.variations_form {
    display: flex !important;
    flex-wrap: wrap !important;
    flex-direction: row !important;
}
.single-product form.cart .variations {
    width: 100%;
}
.single-product form.cart .woocommerce-variation-add-to-cart {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
    width: 100%;
}
.single-product form.cart .single_variation_wrap {
    width: 100%;
}
.single-product .cart button.single_add_to_cart_button,
.single-product .cart button.single_add_to_cart_button.button.alt {
    background-color: #B50B00 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 4px;
    font-weight: 600;
    padding: 12px 28px;
    margin-top: 0;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    float: none !important;
}
.single-product .cart .quantity {
    float: none !important;
    margin: 0 !important;
}
.single-product .cart button.single_add_to_cart_button:hover {
    background-color: #8f0900 !important;
}


/* ==========================================================================
   MINI CART — Custom AJAX cart (not a Divi module)
   ========================================================================== */

.ams-mc-item-sku {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}
.ams-mc-item-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}
.ams-mc-remove {
    position: static !important;
    background: none !important;
    border: none !important;
    cursor: pointer;
    color: #999 !important;
    font-size: 11px !important;
    padding: 4px 0 0 !important;
    line-height: 1;
    text-decoration: underline;
    transition: color 0.2s;
}
.ams-mc-remove:hover {
    color: #B50B00 !important;
}


/* ==========================================================================
   COMPARE BUTTON — WCBoost plugin (not a Divi module)
   ========================================================================== */

.single-product .summary .wcboost-products-compare-button {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    margin: 0 0 0 12px !important;
    vertical-align: middle;
    font-size: 13px;
    color: #666;
    text-decoration: none;
    position: relative;
    top: -2px;
}
.single-product .summary .wcboost-products-compare-button:hover {
    color: #B50B00;
}
.single-product .summary .cart .woocommerce-variation-add-to-cart {
    display: inline-flex !important;
    align-items: center;
}


/* ==========================================================================
   BLOG LISTING — Theme Builder specificity override
   Divi parent theme's deep selectors require matching specificity.
   ========================================================================== */

.et-db #et-boc .et-l .et_pb_post h2.entry-title a {
    color: #B50B00 !important;
}
.et-db #et-boc .et-l .et_pb_post h2.entry-title a:hover {
    color: #8a0900 !important;
}
