/**
 * Marine Mart Product Variants Styles
 */

/* Container */
.mm-product-variants {
    margin: 40px 0;
    position: relative;
    width: 100%;
}

/* Subcategory Tabs */
.mm-subcategory-tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.mm-tab-button {
    background: none;
    border: none;
    color: #999;
    font-size: 16px;
    font-weight: 600;
    padding: 10px 0;
    cursor: pointer;
    transition: color 0.3s ease;
    position: relative;
}

.mm-tab-button:hover {
    color: #f47920; /* Brand orange */
}

.mm-tab-button.active {
    color: #f47920;
}

.mm-tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    right: 0;
    height: 2px;
    background: #f47920;
}

/*.mm-tab-button:focus {
    outline: 2px solid #f47920;
    outline-offset: 4px;
}*/

/* Carousel Container */
.mm-carousel-container {
    position: relative;
    margin-bottom: 0;
}

.mm-carousel-wrapper {
    display: none;
    position: relative;
}

.mm-carousel-wrapper.active {
    display: flex;
    align-items: stretch; /* Changed from center to stretch */
    gap: 20px;
}

/* Carousel */
.mm-carousel {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    position: relative;
    align-self: stretch; /* Ensure it stretches to wrapper height */
}

.mm-carousel::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.mm-carousel.dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

/* Gradient shadows on carousel edges */
.mm-carousel-wrapper::before,
.mm-carousel-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mm-carousel-wrapper::before {
    left: 44px; /* Position after left nav button */
    background: linear-gradient(to right, rgba(0, 0, 0, 0.8), transparent);
}

.mm-carousel-wrapper::after {
    right: 44px; /* Position before right nav button */
    background: linear-gradient(to left, rgba(0, 0, 0, 0.8), transparent);
}

/* Show left shadow when scrolled right */
.mm-carousel-wrapper.has-scroll-left::before {
    opacity: 1;
}

/* Show right shadow when has more items to right */
.mm-carousel-wrapper.has-scroll-right::after {
    opacity: 1;
}

.mm-carousel-track {
    display: flex;
    gap: 20px;
    padding: 10px 0 0 0;
    min-height: 120px; /* Minimum height based on variant item size */
}

/* Variant Items */
.mm-variant-item {
    flex: 0 0 auto;
    width: 120px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    padding: 15px;
    border: 2px solid transparent;
    border-radius: 8px 8px 0 0;
    background: transparent;
}

.mm-variant-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.mm-variant-item.active {
    background: rgba(255, 255, 255, 0.08);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.mm-variant-icon {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0;
}

.mm-variant-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.mm-variant-label {
    color: #fff;
}

.mm-variant-model {
    font-weight: 600;
    font-size: 0.875em;
	line-height: 1.2;
}

.mm-variant-desc {
    font-size: 0.875em;
	line-height: 1.2;
    color: rgba(255,255,255,0.8);
}

/* Carousel Navigation */
body[data-button-style^="rounded"] button.mm-carousel-nav, 
.mm-carousel-wrapper button.mm-carousel-nav,
.mm-carousel-nav {
    flex: 0 0 auto !important;
    width: 44px !important;
    height: auto !important; /* Let it size to content */
    min-height: 0 !important; /* Remove min-height */
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important; /* Centers arrow icon vertically */
    justify-content: center !important; /* Centers arrow icon horizontally */
    color: #008c89 !important;
    transition: opacity 0.3s ease;
    align-self: stretch !important; /* Ensures button stretches to match siblings */
    padding: 0 !important; /* Remove any theme padding */
    margin: 0 !important; /* Remove any theme margin */
}

/* Left button - only right border */
body[data-button-style^="rounded"] button.mm-carousel-prev, 
.mm-carousel-wrapper button.mm-carousel-prev,
.mm-carousel-prev {
    border-right: 2px solid #008c89 !important;
}

/* Right button - only left border */
body[data-button-style^="rounded"] button.mm-carousel-next, 
.mm-carousel-wrapper button.mm-carousel-next,
.mm-carousel-next {
    border-left: 2px solid #008c89 !important;
}

.mm-carousel-nav:hover:not(.disabled) {
    background: rgba(0, 140, 137, 0.1);
}

.mm-carousel-nav.disabled {
    opacity: 0;
    pointer-events: none;
}

.mm-carousel-nav svg {
    width: 24px;
    height: 24px;
}

/* Expandable Detail Section */
.mm-variant-detail {
    display: none;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 0 0 8px 8px;
    padding: 40px;
    margin-top: 0;
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mm-variant-detail-inner {
    display: grid;
    grid-template-columns: 300px 1fr 1fr;
    gap: 40px;
    align-items: center;
}

/* Detail Image */
.mm-variant-detail-image {
    width: 100%;
}

.mm-variant-detail-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Detail Content */
.mm-variant-detail-content {
    color: #fff;
}

.mm-variant-detail-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #fff;
}

.mm-variant-detail-included h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #fff;
}

.mm-variant-included-content {
    margin-bottom: 30px;
    line-height: 1.8;
}

.mm-variant-included-content ul {
    list-style: none;
    padding: 0;
}

.mm-variant-included-content li {
    padding-left: 20px;
    position: relative;
    margin-bottom: 8px;
}

/* Purchasing Button - Salient Theme Style */
.mm-btn-purchasing {
    display: inline-block;
    background: #f47920;
    color: #fff;
    padding: 12px 24px;
    border-radius: 200px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    line-height: 1.2;
	font-size: 1rem;
	font-family: Poppins;
}

.mm-btn-purchasing:hover {
    background: #e56a15;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 121, 32, 0.3);
    color: #fff;
}

/* Specifications Table */
.mm-variant-detail-specs {
    color: #fff;
}

.mm-specs-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent !important;
    border: none !important;
	line-height: 1.2;
}

.mm-specs-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.9);
    background: transparent !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
}

.mm-specs-table tr:last-child {
    border-bottom: none;
}

.mm-specs-table td,
.mm-specs-table th {
    padding: 22px 0 12px !important;
    border: none !important;
	vertical-align: bottom;
}

.mm-spec-label {
    font-weight: 600;
    width: 50%;
}

.mm-spec-value {
    font-weight: 500;
    text-align: right;
}

/* Override Salient theme table styles */
body:not(.woocommerce-cart) .main-content .mm-specs-table {
    background: transparent !important;
    border: none !important;
}

body:not(.woocommerce-cart) .main-content .mm-specs-table tr {
    background: transparent !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
}

body:not(.woocommerce-cart) .main-content .mm-specs-table tr:nth-child(2n+1) {
    background: transparent !important;
}

body:not(.woocommerce-cart) .main-content .mm-specs-table tr td,
body:not(.woocommerce-cart) .main-content .mm-specs-table tr th {
    border: none !important;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .mm-variant-detail-inner {
        grid-template-columns: 250px 1fr;
        gap: 30px;
    }

    .mm-variant-detail-specs {
        grid-column: 1 / -1;
    }

    .mm-specs-table {
        max-width: 500px;
    }
}

@media (max-width: 768px) {
    .mm-subcategory-tabs {
        gap: 15px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .mm-subcategory-tabs::-webkit-scrollbar {
        display: none;
    }

    .mm-tab-button {
        white-space: nowrap;
        font-size: 14px;
    }

    .mm-carousel-wrapper.active {
        gap: 10px;
        min-height: 120px; /* Adjust minimum height for mobile */
    }

    .mm-carousel-nav {
        width: 36px;
        height: 100%;
    }

    .mm-carousel-nav svg {
        width: 20px;
        height: 20px;
    }

    .mm-variant-item {
        width: 100px;
        padding: 12px;
    }

    .mm-variant-icon {
        height: 60px;
    }

    .mm-variant-detail {
        padding: 30px 20px;
    }

    .mm-variant-detail-inner {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .mm-variant-detail-image {
        max-width: 300px;
        margin: 0 auto;
    }

    .mm-variant-detail-title {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .mm-specs-table {
        max-width: 100%;
    }

    .mm-spec-label,
    .mm-spec-value {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .mm-variant-item {
        width: 90px;
        padding: 10px;
    }

    .mm-variant-icon {
        height: 50px;
    }

    .mm-variant-model {
        font-size: 1em;
    }

    .mm-variant-desc {
        font-size: 0.875em;
    }

    .mm-carousel-track {
        gap: 12px;
    }
}
