/*
 Theme Name:   The Motor Control Center
 Theme URI:    https://contactsandcoils.com
 Description:  A Divi child theme for Contacts and Coils
 Author:       Contacts and Coils
 Author URI:   https://contactsandcoils.com
 Template:     Divi
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  the-motor-control-center
*/

/* Add your custom styles below this line */

/* WooCommerce Product and Category Images - Make Square */
.woocommerce ul.products li.product .woocommerce-loop-product__link img,
.woocommerce ul.products li.product-category .woocommerce-loop-category__title img,
.woocommerce ul.products li.product img,
.woocommerce ul.products li.product-category img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    width: 100%;
    height: auto;
}

/* Category Title - Larger and Bold */
.woocommerce-loop-category__title {
    font-size: 1.25em !important;
    font-weight: bold !important;
}

/* Remove Yellow Highlight on Product Counts */
.woocommerce-loop-category__title .count,
.woocommerce ul.products li.product-category mark {
    background: none !important;
    background-color: transparent !important;
    color: inherit;
}

/* WooCommerce Breadcrumb - Center, Larger, Bold */
.woocommerce-breadcrumb {
    text-align: center !important;
    font-size: 1.15em !important;
    font-weight: bold !important;
}

.woocommerce-breadcrumb a {
    color: #94abdd !important;
    text-decoration: none;
}

.woocommerce-breadcrumb a:hover {
    text-decoration: underline;
}

/* ET Top Navigation - Same Color for Active and Hover */
#et-top-navigation nav > ul > li.current-menu-item > a,
#et-top-navigation nav > ul > li > a:hover {
    color: #94abdd !important;
}

/* ET Page Builder Menu - Consistent Styling */
.et_pb_menu__wrap nav > ul > li.current-menu-item > a,
.et_pb_menu__wrap nav > ul > li > a:hover,
.et_pb_menu ul li.current-menu-item > a,
.et_pb_menu ul li > a:hover {
    color: #94abdd !important;
}

/* Header Menu - Consistent 14px Font Size */
#et-top-navigation nav > ul > li > a,
.et_pb_menu__wrap nav > ul > li > a,
.et_pb_menu ul li > a,
.et_pb_menu .et_pb_menu__menu > nav > ul > li > a,
.et_pb_menu__wrap .et_pb_menu__menu > nav > ul > li > a,
#main-header .et_pb_menu ul li a,
.et_pb_fullwidth_menu .et_pb_menu__wrap nav > ul > li > a {
    font-size: 14px !important;
}

/* Fix et_top_search */
#et_top_search {
    display: inline-block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.et_search_form_container {
    display: block !important;
}

/* Search Results Page Styling */
.search #left-area {
    width: 100% !important;
    float: none !important;
    border-right: none !important;
    margin-right: 0 !important;
    border: none !important;
}

.search #main-content {
    min-height: 600px;
}

.search #main-content .container {
    max-width: 1200px;
    margin: 0 auto;
}

.search #main-content .container:before,
.search #main-content .container:after {
    display: none !important;
}

.search #content-area {
    border: none !important;
}

.search #search-header {
    margin-bottom: 0;
}

.search .no-results {
    text-align: center;
    padding: 60px 20px;
}

/* Remove sidebar on search results */
.search #sidebar {
    display: none !important;
}

/* Search Results List View */
.tmcc-search-results {
    margin: 0;
    padding: 0;
}

.tmcc-search-result-item {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    border-bottom: none;
}

.tmcc-search-result-item:first-child {
    padding-top: 0;
}

.tmcc-search-thumbnail {
    flex-shrink: 0;
    width: 150px;
}

.tmcc-search-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid #e0e0e0;
}

.tmcc-search-details {
    flex-grow: 1;
}

.tmcc-search-title {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: bold;
}

.tmcc-search-title a {
    color: #333;
    text-decoration: none;
}

.tmcc-search-title a:hover {
    color: #94abdd;
}

.tmcc-search-meta {
    margin-bottom: 10px;
    display: flex;
    gap: 20px;
    align-items: center;
}

.tmcc-search-price {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.tmcc-search-sku {
    font-size: 14px;
    color: #666;
}

.tmcc-search-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .tmcc-search-result-item {
        flex-direction: column;
    }

    .tmcc-search-thumbnail {
        width: 100%;
        max-width: 200px;
    }
}

/* WooCommerce Product Gallery - Fix Image Display */
.woocommerce-product-gallery__wrapper img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
}

.woocommerce-product-gallery__image {
    width: 100% !important;
    height: auto !important;
}

.woocommerce-product-gallery {
    opacity: 1 !important;
}

/* WooCommerce Product Gallery Modal - Max Width 900px, Responsive */
.pswp__img {
    max-width: 900px !important;
    width: auto !important;
    height: auto !important;
    margin: 0 auto !important;
}

.pswp__zoom-wrap {
    max-width: 900px !important;
    margin: 0 auto !important;
}

@media (max-width: 920px) {
    .pswp__img,
    .pswp__zoom-wrap {
        max-width: 95% !important;
    }
}

/* Custom Product Lightbox Modal */
#tmcc-lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.tmcc-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1;
}

.tmcc-lightbox-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tmcc-lightbox-content img {
    max-width: 900px;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
}

.tmcc-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 3;
    line-height: 1;
    transition: color 0.3s ease;
}

.tmcc-lightbox-close:hover {
    color: #ccc;
}

@media (max-width: 920px) {
    .tmcc-lightbox-content img {
        max-width: 95%;
    }
}

/* Uniform Product Card Heights */
.woocommerce ul.products li.product {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

.woocommerce ul.products li.product .woocommerce-loop-product__link {
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
}

/* Fix product title height - limit to 5 lines with ellipsis */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h2,
.woocommerce ul.products li.product h3 {
    min-height: 7em !important;
    max-height: 7em !important;
    line-height: 1.4em !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 5 !important;
    -webkit-box-orient: vertical !important;
    margin-bottom: 10px !important;
}

/* Ensure image container has consistent height */
.woocommerce ul.products li.product .woocommerce-loop-product__link img {
    flex-shrink: 0 !important;
}

/* Price container - consistent spacing */
.woocommerce ul.products li.product .price {
    margin-top: auto !important;
    margin-bottom: 10px !important;
    text-align: center !important;
}

/* Price styling - larger, bold, custom color */
.woocommerce ul.products li.product .price .woocommerce-Price-amount,
.woocommerce ul.products li.product .price .amount {
    font-size: 1.5em !important;
    font-weight: bold !important;
    color: #28529d !important;
}
