:root {
    /* Colors */
    --gtpt-primary-color: #27272a;
    --gtpt-secondary-color: #FF6200;
    --gtpt-text-color: #333333;
    --gtpt-light-text-color: #666666;
    --gtpt-border-color: #e0e0e0;
    --gtpt-background-color: #ffffff;
    --gtpt-light-background-color: #f7fafc;
    --gtpt-hover-background-color: #edf2f7;
    --gtpt-sale-color: #dc2626;
    --gtpt-out-of-stock-color: #e74c3c;
    --gtpt-success-color: #15803d;
    --gtpt-input-border-color: #e0e0e0;
    --gtpt-input-background-color: #ffffff;
    --gtpt-button-background-color: #27272a;
    --gtpt-button-text-color: #ffffff;
    --gtpt-button-hover-background-color: #424242;
    --gtpt-accent-color: #FF6200;

    /* Typography */
    --gtpt-font-family: var( --e-global-typography-89a02b9-font-family );
    --gtpt-font-size-xs: 0.75rem;
    --gtpt-font-size-sm: 0.875rem;
    --gtpt-font-size-md: 1rem;
    --gtpt-font-size-lg: 1.125rem;
    --gtpt-font-size-xl: 1.25rem;
    --gtpt-font-size-2xl: 1.5rem;
    --gtpt-font-size-3xl: 1.875rem;
    --gtpt-font-size-4xl: 2.25rem;

    /* Spacing */
    --gtpt-spacing-xs: 0.25rem;
    --gtpt-spacing-sm: 0.5rem;
    --gtpt-spacing-md: 1rem;
    --gtpt-spacing-lg: 1.5rem;
    --gtpt-spacing-xl: 2rem;
    --gtpt-spacing-2xl: 3rem;
    --gtpt-spacing-3xl: 4rem;

    /* Border Radius */
    --gtpt-border-radius: 0.25rem;

    /* Box Shadow */
    --gtpt-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* Desktop layout */
.gtpt-page-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 var(--gtpt-spacing-xl);
}

.gtpt-product-image-mobile {
    display: none;
}

.gtpt-product-container {
    display: flex;
    gap: var(--gtpt-spacing-xl);
    min-height: 500px;
}

.gtpt-product-image-desktop {
    flex: 0 0 45%;
    min-width: 300px;
    width: 45%;
}

.gtpt-product-details {
    flex: 1;
    max-width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--gtpt-spacing-md);
    padding: var(--gtpt-spacing-xl) 0;
}

/* Mobile layout */
@media (max-width: 768px) {
    .gtpt-page-container {
        padding: 0 var(--gtpt-spacing-md);
    }

    .gtpt-product-image-desktop {
        display: none;
    }

    .gtpt-product-image-mobile {
        display: block;
        width: 100%;
        order: 5;
    }

    .gtpt-product-container {
        flex-direction: column;
        gap: var(--gtpt-spacing-md);
        min-height: unset;
    }

    .gtpt-product-details {
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        gap: var(--gtpt-spacing-xs);
        justify-content: flex-start;
        padding: 0;
    }

    /* Reorder elements in mobile */
    .gtpt-product-container {
        display: flex;
        flex-direction: column;
    }

    .gtpt-back-to-shop { order: 1; }
    .gtpt-product-category { order: 2; }
    .gtpt-product-title { order: 3; }
    .gtpt-product-short-description { order: 4; }
    .gtpt-product-image-mobile { order: 5; }
    .gtpt-product-action-wrapper { order: 6; }
    .gtpt-product-meta { order: 7; }
}

/* Tablet breakpoint */
@media (min-width: 769px) and (max-width: 1024px) {
    .gtpt-product-container {
        grid-template-columns: 400px 1fr;  /* Slightly smaller image column */
        gap: var(--gtpt-spacing-xl);
    }
}

/* Related Products Grid Adjustments */
.gtpt-related-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Show 4 items per row by default */
    gap: var(--gtpt-spacing-xl);
}

@media (max-width: 1200px) {
    .gtpt-related-products-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 items per row */
    }
}

@media (max-width: 992px) {
    .gtpt-related-products-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 items per row */
    }
}

@media (max-width: 576px) {
    .gtpt-related-products-grid {
        grid-template-columns: 1fr; /* 1 item per row */
    }
}

/* Product Details - START */
.gtpt-product-details {
    flex: 1;
    max-width: 40%;
}

@media (max-width: 768px) {
    .gtpt-product-details {
        flex-basis: 100%;
        max-width: 100%;
    }
}
/* Product Details - END */

/* Back to Shop Link - START */
.gtpt-back-to-shop {
    display: inline-block;
    margin-bottom: var(--gtpt-spacing-md);
    text-decoration: none;
    color: var(--gtpt-text-color);
    font-weight: bold;
    font-size: var(--gtpt-font-size-md);
    font-family: var(--e-global-typography-89a02b9-font-family);
}
/* Back to Shop Link - END */

/* Product Title - START */
.gtpt-product-title {
    font-size: var(--gtpt-font-size-3xl);
    font-weight: 700;
    color: var(--gtpt-text-color);
    margin-bottom: var(--gtpt-spacing-sm);
    font-family: var(--e-global-typography-89a02b9-font-family);
}

@media (max-width: 576px) {
    .gtpt-product-title {
        font-size: var(--gtpt-font-size-2xl);
    }
}
/* Product Title - END */

/* Product Meta - START */
.gtpt-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: var(--gtpt-spacing-md);
    font-size: 0.875rem;
    line-height: 1;
}

.gtpt-product-sku,
.gtpt-product-stock,
.gtpt-product-brand {
    background-color: rgb(249, 250, 251);
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid rgb(229, 231, 235);
    display: inline-flex;
    align-items: center;
    height: 32px;
}

.gtpt-label {
    font-weight: 500;
    color: rgb(17, 24, 39);
    margin-right: 0.25rem;
}

.gtpt-value {
    color: rgb(107, 114, 128);
    font-weight: 400;
}

@media (max-width: 768px) {
    .gtpt-product-meta {
        gap: 0.75rem;  /* Increased gap for vertical stacking */
    }

    .gtpt-product-sku,
    .gtpt-product-stock,
    .gtpt-product-brand {
        width: fit-content;  /* Allow tags to be only as wide as content */
    }
}
/* Product Meta - END */

/* Product Category - START */
.gtpt-product-category {
    margin-bottom: var(--gtpt-spacing-xs);
    font-size: var(--gtpt-font-size-sm);
    color: var(--gtpt-light-text-color);
}

.gtpt-category-label {
    font-weight: bold;
    color: var(--gtpt-light-text-color);
}

.gtpt-category-label + a,
.gtpt-product-category a {
    color: var(--e-global-color-6cbd519);
}

.gtpt-category-label + a:hover,
.gtpt-product-category a:hover {
    color: var(--e-global-color-6cbd519);
    text-decoration: underline;
}

/* Product Category - END */

/* Product Brand - START */
.gtpt-product-brand {
    font-size: var(--gtpt-font-size-sm);
    color: var(--gtpt-light-text-color);
}

.gtpt-brand-label {
    font-weight: bold;
    color: var(--gtpt-light-text-color);
}

.gtpt-brand-label + a,
.gtpt-product-brand a {
    color: var(--e-global-color-6cbd519);
}

.gtpt-brand-label + a:hover,
.gtpt-product-brand a:hover {
    color: var(--e-global-color-6cbd519);
    text-decoration: underline;
}
/* Product Brand - END */

/* Product Price and Add to Cart Section - START */
.gtpt-product-purchase {
    display: flex;
    align-items: center;
    gap: var(--gtpt-spacing-lg);
    flex-wrap: wrap;
}

.gtpt-product-price {
    font-size: var(--gtpt-font-size-3xl);
    font-weight: bold;
    color: var(--gtpt-text-color);
    white-space: nowrap;
    align-content: center;
    line-height: 1;
}

.gtpt-product-price del {
    color: var(--gtpt-light-text-color);
    text-decoration: line-through;
    margin-right: 5px;
    font-size: var(--gtpt-font-size-3xl)!important;
}

.gtpt-product-price ins {
    text-decoration: none;
}

.gtpt-product-price .woocommerce-Price-amount {
    font-weight: bold;
}

.gtpt-product-price del .woocommerce-Price-amount {
    font-weight: normal;
}

.gtpt-product-price ins .woocommerce-Price-amount {
    color: var(--gtpt-sale-color);
}

.gtpt-ajax-add-to-cart {
    margin: 0px!important;
    display: flex;
    align-items: center;
}

.gtpt-add-to-cart-wrapper {
    flex-grow: 1;
}

.gtpt-add-to-cart-wrapper form.cart {
    display: flex;
    align-items: center;
    gap: var(--gtpt-spacing-md);
}

.gtpt-quantity-input {
    display: flex;
    align-items: center;
    border: 1px solid var(--gtpt-input-border-color) !important;
    border-radius: var(--gtpt-border-radius)!important;
    overflow: hidden;
}

.gtpt-qty-button {
    background-color: var(--gtpt-input-background-color)!important;
    border: solid 1px var(--gtpt-input-border-color)!important;
    color: var(--gtpt-text-color)!important;
    font-size: var(--gtpt-font-size-xl);
    padding: var(--gtpt-spacing-sm) var(--gtpt-spacing-md);
    cursor: pointer;
    transition: background-color 0.2s;
    margin: -1px;
}

.gtpt-qty-button:hover {
    background-color: var(--gtpt-hover-background-color)!important;
}

.gtpt-quantity-input .quantity {
    margin: 0;
    padding: 0;
}

.single_add_to_cart_button {}

.woocommerce div.product form.cart div.quantity {
    float: left;
    margin: 0 0 0 0!important;
  }

.gtpt-qty-input {
    width: 3rem !important;
    border: none !important;
    text-align: center !important;
    font-size: var(--gtpt-font-size-md) !important;
    padding: var(--gtpt-spacing-sm) 0 !important;
    -moz-appearance: textfield !important;
    background-color: transparent !important;
    margin: 0 !important;
}

.gtpt-qty-input::-webkit-outer-spin-button,
.gtpt-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.gtpt-ajax-add-to-cart-button {
    display: flex!important;
    align-items: center;
    justify-content: center;
    gap: var(--gtpt-spacing-sm);
    background-color: var(--gtpt-button-background-color) !important;
    color: var(--gtpt-button-text-color) !important;
    font-weight: 600;
    font-size: var(--gtpt-font-size-md);
    border-radius: var(--gtpt-border-radius);
    transition: background-color 0.2s;
    text-transform: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.gtpt-cart-icon {
    width: 16px;
    height: 16px;
}

.gtpt-ajax-add-to-cart-button:hover {
    background-color: var(--gtpt-button-hover-background-color) !important;
    align-items: center;
}

.added_to_cart {
    margin-left: var(--gtpt-spacing-sm);
    font-size: var(--gtpt-font-size-sm);
    color: var(--gtpt-primary-color);
    text-decoration: none;
}

.added_to_cart:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .gtpt-product-purchase {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--gtpt-spacing-md);
    }

    .gtpt-add-to-cart-wrapper {
        width: 100%;
    }

    .gtpt-add-to-cart-wrapper form.cart {
        flex-wrap: wrap;
    }

    .gtpt-quantity-input {
        flex-grow: 0;
    }

    .gtpt-ajax-add-to-cart-button {
        flex-grow: 1;
    }
}

@media (max-width: 576px) {
    .gtpt-product-price {
        font-size: var(--gtpt-font-size-3xl);
    }

    .gtpt-add-to-cart-wrapper form.cart {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        gap: var(--gtpt-spacing-sm);
    }

    /* .gtpt-quantity-input,
    .gtpt-ajax-add-to-cart-button {
        flex: 0;
        max-width: calc(50% - var(--gtpt-spacing-xs));
    } */

    .added_to_cart {
        margin-left: 0;
        margin-top: var(--gtpt-spacing-sm);
        text-align: center;
    }
}
/* Product Price and Add to Cart Section - END */

/* Divider in Product Action - START */
.gtpt-product-action-wrapper {
    position: relative;
    padding: 20px 0;
    margin-bottom: var(--gtpt-spacing-md);
    margin-top: var(--gtpt-spacing-md);
}
.gtpt-product-action-wrapper::before,
.gtpt-product-action-wrapper::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #e0e0e0;
}
.gtpt-product-action-wrapper::before {
    top: 0;
}
.gtpt-product-action-wrapper::after {
    bottom: 0;
}
/* Divider in Product Action - END */

/* Product Description - START */
.gtpt-product-desc-title {
    font-size: var(--gtpt-font-size-md);
    font-weight: bold;
    color: var(--gtpt-light-text-color);
}

.gtpt-product-description {
    margin-top: var(--gtpt-spacing-md);
    margin-bottom: var(--gtpt-spacing-xl);
    line-height: 1.6;
    color: var(--gtpt-text-color);
    font-size: var(--gtpt-font-size-md);
    font-family: var(--e-global-typography-89a02b9-font-family);
}
/* Product Description - END */

/* Additional Information - START */
.gtpt-additional-info p {
    font-size: var(--gtpt-font-size-md);
    padding-bottom: 5px;
    font-weight: bold;
    color: var(--gtpt-light-text-color);
}

.woocommerce table.shop_attributes {
    border: 1px solid var(--gtpt-border-color) !important;
    border-radius: var(--gtpt-border-radius) !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100% !important;
    overflow: hidden !important;
    font-size: var(--gtpt-font-size-sm);
}

.woocommerce table.shop_attributes th,
.woocommerce table.shop_attributes td {
    border: none !important;
    background: transparent !important;
    border-bottom: 1px solid var(--gtpt-border-color) !important;
    border-right: 1px solid var(--gtpt-border-color) !important;
    padding: var(--gtpt-spacing-sm) var(--gtpt-spacing-md) !important;
    vertical-align: middle !important;
    text-align: left !important;
}

.woocommerce table.shop_attributes tr:last-child th,
.woocommerce table.shop_attributes tr:last-child td {
    border-bottom: none !important;
}

.woocommerce table.shop_attributes th:last-child,
.woocommerce table.shop_attributes td:last-child {
    border-right: none !important;
}

.woocommerce table.shop_attributes th {
    font-weight: bold !important;
}

@media (max-width: 768px) {
    .woocommerce table.shop_attributes tr {
        display: block !important;
    }

    .woocommerce table.shop_attributes th,
    .woocommerce table.shop_attributes td {
        display: block !important;
        width: 100% !important;
        border: none !important;
        padding: var(--gtpt-spacing-sm) var(--gtpt-spacing-md) !important;
    }
}
/* Additional Information - END */

/* Out of Stock Message - START */
.gtpt-out-of-stock {
    color: var(--gtpt-out-of-stock-color);
    font-weight: 600;
    font-size: var(--gtpt-font-size-lg);
}
/* Out of Stock Message - END */

/* WooCommerce Message - START */
.woocommerce-message {
    display: none;
}
/* WooCommerce Message - END */

/* WooCommerce Override */
.woocommerce #content div.product div.images,
.woocommerce div.product div.images,
.woocommerce-page #content div.product div.images,
.woocommerce-page div.product div.images {
    float: none !important;
    width: 100% !important;
}

/* Main Gallery */
.woocommerce-product-gallery {
    width: 100%;
    border: 1px solid var(--gtpt-border-color);
    border-radius: var(--gtpt-border-radius);
    background: #fff;
    padding: 15px;
}

/* Gallery Wrapper */
.woocommerce-product-gallery__wrapper {
    margin: 0;
    position: relative;
}

/* Main Image Container */
.woocommerce-product-gallery__image {
    width: 100%;
    height: 500px !important;
    position: relative;
    overflow: hidden;
}

.woocommerce-product-gallery__image a {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    display: block;
}

.woocommerce-product-gallery__image img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
}

/* Remove all zoom functionality */
.woocommerce-product-gallery__trigger,
.zoomImg {
    display: none !important;
}

/* Ensure flex-viewport doesn't interfere */
.flex-viewport {
    overflow: hidden !important;
}

/* Thumbnails */
.flex-control-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 15px!important;
    padding: 0;
    list-style: none;
}

.flex-control-thumbs li {
    width: 80px;
    border: 1px solid var(--gtpt-border-color);
    border-radius: var(--gtpt-border-radius);
    padding: 5px;
    background: #fff;
}

.flex-control-thumbs img {
    width: 100%;
    height: auto;
    opacity: 0.6;
    cursor: pointer;
}

.flex-control-thumbs img:hover,
.flex-control-thumbs img.flex-active {
    opacity: 1;
}

/* Keep the trigger visible but style it nicely */
.woocommerce-product-gallery__trigger {
    background: #fff !important;
    border-radius: 50% !important;
    border: 1px solid var(--gtpt-border-color) !important;
    box-shadow: var(--gtpt-box-shadow);
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .flex-viewport,
    .woocommerce-product-gallery__image {
        min-height: 300px !important;
    }

    .woocommerce-product-gallery__image {
        height: 400px !important;
    }
}

@media (max-width: 768px) {
    .gtpt-product-image {
        max-width: 100%;
    }
    
    .flex-viewport,
    .woocommerce-product-gallery__image {
        height: 280px !important;
    }
    
    .flex-control-thumbs li {
        width: 70px;
    }

    .woocommerce-product-gallery__image {
        height: 350px !important;
    }
}

@media (max-width: 576px) {
    .flex-viewport,
    .woocommerce-product-gallery__image {
        height: 250px !important;
    }
    
    .flex-control-thumbs li {
        width: 60px;
    }

    .woocommerce-product-gallery__image {
        height: 300px !important;
    }
}

.gtpt-backorder-notice {
    margin-top: var(--gtpt-spacing-sm);
    padding: var(--gtpt-spacing-sm) var(--gtpt-spacing-md);
    background-color: #fff3e0;
    border-left: 4px solid var(--gtpt-accent-color);
    border-radius: var(--gtpt-border-radius);
    font-size: var(--gtpt-font-size-sm);
    color: var(--gtpt-text-color);
    margin-bottom: var(--gtpt-spacing-md);
}

.gtpt-backorder-notice p {
    margin: 0;
}

/* Page Layout and Extended Info Styles */
.gtpt-product-extended-info {
    margin-top: var(--gtpt-spacing-xs);
    padding-top: var(--gtpt-spacing-xs);
    border-top: 1px solid var(--gtpt-border-color);
}

.gtpt-product-short-description {
    margin-top: var(--gtpt-spacing-xs);
    color: var(--gtpt-text-color);
    font-size: var(--gtpt-font-size-md);
    line-height: 1.6;
}

/* Related Products Styling */
.gtpt-related-products {
    margin-top: var(--gtpt-spacing-3xl);
}

.gtpt-related-products h2 {
    font-size: var(--gtpt-font-size-2xl);
    margin-bottom: var(--gtpt-spacing-xl);
    color: var(--gtpt-text-color);
}

.gtpt-related-product-card {
    border: 1px solid var(--gtpt-border-color);
    border-radius: var(--gtpt-border-radius);
    padding: var(--gtpt-spacing-md);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.gtpt-related-product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--gtpt-box-shadow);
}

.gtpt-related-product-card a {
    text-decoration: none;
    color: var(--gtpt-text-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Image container */
.gtpt-related-product-card a > :first-child {
    height: 200px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--gtpt-spacing-md);
    background: #fff;
}

.gtpt-related-product-card img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.gtpt-related-product-card h3 {
    font-size: var(--gtpt-font-size-md);
    margin-bottom: var(--gtpt-spacing-sm);
    flex-grow: 1;
}

.gtpt-related-product-price {
    color: var(--gtpt-primary-color);
    font-weight: bold;
}

@media (max-width: 768px) {
    .gtpt-related-product-card a > :first-child {
        height: 180px;
    }
}

@media (max-width: 576px) {
    .gtpt-related-product-card a > :first-child {
        height: 160px;
    }
}

@media (min-width: 769px) {
    /* Reset orders for desktop */
    .gtpt-back-to-shop,
    .gtpt-product-category,
    .gtpt-product-title,
    .gtpt-product-short-description,
    .gtpt-product-image,
    .gtpt-product-meta,
    .gtpt-product-action-wrapper {
        order: unset;
    }
}