/*
 * woocommerce.css — My Custom Theme
 * WooCommerce-specific styling. Loaded only on WooCommerce pages.
 */

/* ── Single product layout ─────────────────────────────────────────────────── */

.single-product-wrap {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 2.5rem;
    align-items: start;
    margin-bottom: 2rem;
    position: relative;
    isolation: isolate;
    z-index: 0;
}

/* Force gallery into column 1 and summary into column 2, regardless of any
   float/width rules WooCommerce's own core CSS tries to apply to them. */
.single-product-wrap > .woocommerce-product-gallery,
.single-product-wrap > div.images {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
}
.single-product-wrap > .summary.entry-summary,
.single-product-wrap > div.summary {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    grid-column: 2 !important;
    grid-row: 1 !important;
}

/* Grid establishes its own formatting context, but add a belt-and-braces
   clearfix in case a plugin/theme rule ever forces display back to block. */
.single-product-wrap::after {
    content: "";
    display: table;
    clear: both;
}

@media ( max-width: 782px ) {
    .single-product-wrap {
        display: block !important;
    }
    .single-product-wrap > .woocommerce-product-gallery,
    .single-product-wrap > div.images,
    .single-product-wrap > .summary.entry-summary,
    .single-product-wrap > div.summary,
    .single-product-wrap > .mct-product-tabs {
        display: block !important;
        grid-column: auto !important;
        grid-row: auto !important;
        width: 100% !important;
        margin: 0 0 1.5rem !important;
    }
    .single-product-wrap > .mct-product-tabs {
        margin-top: .5rem !important;
    }
}

.single-product-wrap .woocommerce-product-gallery {
    background: var( --color-surface, #f9fafb );
    border-radius: var( --radius-lg, 8px );
    overflow: hidden;
}

/* Gap between the main image and the thumbnail row, and between thumbnails */
.single-product-wrap .woocommerce-product-gallery__wrapper {
    margin-bottom: 12px;
}
.single-product-wrap .flex-control-nav.flex-control-thumbs,
.single-product-wrap ol.flex-control-thumbs {
    display: flex !important;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    margin: 12px 0 0 !important;
    padding: 0 !important;
}
.single-product-wrap .flex-control-thumbs li {
    width: calc( 25% - 8px ) !important;
    float: none !important;
    margin: 0 !important;
}
.single-product-wrap .flex-control-thumbs li img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    cursor: pointer;
    opacity: .65;
    transition: opacity .15s ease;
}
.single-product-wrap .flex-control-thumbs li img.flex-active,
.single-product-wrap .flex-control-thumbs li img:hover {
    opacity: 1;
}

.single-product-wrap .summary.entry-summary {
    padding-top: .5rem;
}

.single-product-wrap .product_title {
    font-size: 1.75rem;
    color: var( --color-secondary, #1e40af );
    margin-bottom: 1rem;
}

/* Feature bullet list (replaces price / add-to-cart / excerpt) */
.mct-product-features {
    list-style: none;
    margin: 0;
    padding: 0;
}
.mct-product-features li {
    position: relative;
    padding: .4rem 0 .4rem 1.5rem;
    font-size: .975rem;
    color: var( --color-text, #1f2937 );
    border-bottom: 1px dashed var( --color-border, #e5e7eb );
}
.mct-product-features li:last-child {
    border-bottom: none;
}
.mct-product-features li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .85rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var( --color-primary, #2563eb );
}

/* ── Specification / Download tabs ────────────────────────────────────────── */

.mct-product-tabs {
    display: block !important;
    float: none !important;
    clear: both !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    margin-top: 2rem;
}

/* .mct-product-tabs is rendered *inside* .single-product-wrap (it's the 3rd
   grid item, after the gallery and the summary), so it must explicitly span
   every column and drop to a new row — otherwise the grid only gives it the
   width of whichever single cell it was auto-placed into. */
.single-product-wrap > .mct-product-tabs {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
}

.mct-product-tabs__nav {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var( --color-border, #e5e7eb );
    margin-bottom: 0;
}

.mct-tab-btn {
    appearance: none;
    cursor: pointer;
    border: none;
    background: var( --color-surface, #f3f4f6 );
    color: var( --color-secondary, #1e40af );
    font-weight: 600;
    font-size: .95rem;
    padding: .75rem 1.75rem;
    border-radius: 6px 6px 0 0;
    transition: background .15s ease, color .15s ease;
}
.mct-tab-btn.is-active {
    background: var( --color-secondary, #1e40af );
    color: #fff;
}
.mct-tab-btn:not( .is-active ):hover {
    background: #e5e7eb;
}

.mct-product-tabs__panel {
    display: none;
    background: #fff;
    border: 1px solid var( --color-border, #e5e7eb );
    border-top: none;
    padding: 0;
}
.mct-product-tabs__panel.is-active {
    display: block;
}

/* Spec table */
.mct-spec-table {
    width: 100%;
    border-collapse: collapse;
}
.mct-spec-table tr {
    border-bottom: 1px solid var( --color-border, #e5e7eb );
}
.mct-spec-table tr:nth-child( even ):not( .mct-spec-table__group-title ) {
    background: #fafafa;
}
.mct-spec-table th,
.mct-spec-table td {
    text-align: left;
    padding: .65rem 1.25rem;
    font-size: .9rem;
    vertical-align: top;
}
.mct-spec-table th {
    width: 35%;
    font-weight: 600;
    color: var( --color-text, #1f2937 );
}
.mct-spec-table td {
    color: var( --color-muted, #4b5563 );
}
.mct-spec-table__group-title th {
    background: #dbeafe;
    color: var( --color-secondary, #1e40af );
    font-size: .95rem;
    text-transform: none;
    padding: .6rem 1.25rem;
}

/* Download list */
.mct-download-list {
    list-style: none;
    margin: 0;
    padding: 1.25rem;
}
.mct-download-list__item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    border: 1px solid var( --color-border, #e5e7eb );
    border-radius: 6px;
    margin-bottom: .75rem;
}
.mct-download-list__icon {
    font-size: 1.4rem;
}
.mct-download-list__label {
    flex: 1;
    font-weight: 500;
}
.mct-download-list__btn {
    background: var( --color-primary, #2563eb );
    color: #fff;
    padding: .4rem 1rem;
    border-radius: 4px;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
}
.mct-download-list__btn:hover {
    background: var( --color-secondary, #1e40af );
    color: #fff;
}
