/**
 * Single Product Page Styling
 * Matches Original Electro Theme Design
 */

/* Single Product Wrapper */
.single-product-wrapper {
    margin-bottom: 6.429em;
}

.single-product-wrapper.row {
    display: flex;
    flex-wrap: wrap;
}

/* Product Images Wrapper */
.single-product-wrapper .product-images-wrapper {
    width: 100%;
    position: relative;
}

@media (min-width: 768px) {
    .single-product-wrapper .product-images-wrapper {
        flex: 0 0 auto;
        width: 41.66666667%; /* 5/12 columns */
    }
}

/* Product Summary */
.single-product-wrapper .summary {
    width: 100%;
}

@media (min-width: 768px) {
    .single-product-wrapper .summary {
        flex: 0 0 auto;
        width: 58.33333333%; /* 7/12 columns */
    }
}

/* Category Links */
.loop-product-categories {
    display: block;
    font-size: 0.857em;
    line-height: 1.44em;
    overflow: hidden;
    margin-bottom: 0.5em;
}

/* Mobile: Override with horizontal scroll */
@media (max-width: 991.98px) {
    .loop-product-categories {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
        margin-bottom: 8px !important;
        padding: 4px 0 !important;
        gap: 8px !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }
    
    .loop-product-categories::-webkit-scrollbar {
        display: none !important;
    }
    
    .loop-product-categories a {
        display: inline-flex !important;
        align-items: center !important;
        padding: 4px 12px !important;
        background-color: #f5f5f5 !important;
        border-radius: 12px !important;
        font-size: 11px !important;
        color: #666 !important;
        text-decoration: none !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        transition: background-color 0.2s ease, color 0.2s ease !important;
    }
    
    .loop-product-categories a:hover,
    .loop-product-categories a:active {
        background-color: #e0e0e0 !important;
        color: #2563eb !important;
    }
}

.loop-product-categories a {
    color: #999;
}

.loop-product-categories a:hover {
    color: #2563eb;
}

/* Product Title */
.product_title.entry-title {
    font-size: 2em;
    line-height: 1.2em;
    margin-bottom: 0.714em;
    font-weight: 600;
}

/* Brand */
.brand {
    margin-bottom: 1em;
    display: inline-block;
}

.brand img {
    max-height: 30px;
    width: auto;
}

/* Availability */
.availability {
    margin-bottom: 1em;
}

.availability .stock {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.929em;
    margin: 0;
}

.availability .stock i {
    color: #2dcc70;
    font-size: 1.2em;
}

.availability .stock.in-stock {
    color: #2dcc70;
}

.availability .stock.out-of-stock {
    color: #dc3545;
}

/* Divider */
.single-product-title-divider {
    margin: 1.5em 0;
    border: 0;
    border-top: 1px solid #dddddd;
}

/* Action Buttons & Rating */
.action-buttons {
    margin-bottom: 1.5em;
}

.woocommerce-product-rating {
    display: flex;
    align-items: center;
    gap: 10px;
}

.woocommerce-product-rating .star-rating {
    width: 5.4em;
    height: 1em;
    position: relative;
    font-size: 1em;
}

.star-rating::before {
    content: "★★★★★";
    color: #dddddd;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
}

.star-rating span {
    overflow: hidden;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
    padding-top: 1.5em;
}

.star-rating span::before {
    content: "★★★★★";
    top: 0;
    position: absolute;
    left: 0;
    color: #fed700;
}

.woocommerce-review-link {
    color: #999;
    font-size: 0.929em;
    text-decoration: none;
}

.woocommerce-review-link:hover {
    color: #2563eb;
}

/* Price */
.summary .price {
    font-size: 2.571em;
    line-height: 1.222em;
    margin-bottom: 0.5em;
    font-weight: bold;
}

.summary .price del {
    color: #848484;
    font-size: 0.6em;
    line-height: 1.5em;
    margin-left: 0.174em;
    display: inline-block;
}

.summary .price del .amount {
    text-decoration: line-through;
}

.summary .price ins {
    text-decoration: none;
    display: inline-block;
}

.summary .price .amount {
    font-weight: bold;
}

/* Short Description */
.woocommerce-product-details__short-description {
    margin-bottom: 1.786em;
    color: #666;
    font-size: 0.929em;
    line-height: 1.8em;
}

/* Variations Table */
table.variations {
    margin-bottom: 1.786em;
    width: 100%;
    border: none;
}

table.variations tr:last-child td,
table.variations tr:last-child th {
    border-bottom: 1px solid #f2f2f2;
}

table.variations td,
table.variations th {
    vertical-align: middle;
    border-top: 1px solid #f2f2f2;
    padding: 0.857em 0;
}

table.variations td.label {
    display: table-cell;
    color: inherit;
    font-size: 100%;
    font-weight: normal;
    text-align: left;
    width: 30%;
}

table.variations td.label label {
    margin-bottom: 0;
    font-weight: 600;
}

table.variations td.value {
    width: 70%;
}

table.variations td.value select {
    max-width: 100%;
    width: auto;
    display: inline-block;
    border: 1px solid #dddddd;
    border-radius: 1.429em;
    padding: 0.5em 1em;
}

/* Quantity Input */
.quantity {
    display: inline-block;
    margin-right: 10px;
}

.quantity label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 600;
}

.quantity .qty {
    width: 80px;
    border: 1px solid #dddddd;
    border-radius: 1.429em;
    padding: 0.536em 1.214em;
    text-align: center;
}

/* Add to Cart Button */
.single_add_to_cart_button.button {
    color: #fff;
    background-color: #2563eb;
    border-color: #2563eb;
    font-weight: bold;
    font-size: 1em;
    padding: 1.036em 3.434em;
    border-width: 0;
    border-radius: 1.8em;
    display: inline-block;
}

.single_add_to_cart_button.button::before {
    display: inline-block;
    font: normal normal normal 14px/1 font-electro;
    font-size: 1.357em;
    vertical-align: middle;
    content: "\61"; /* Shopping cart icon */
    margin-right: 0.5em;
}

.single_add_to_cart_button.button:hover,
.single_add_to_cart_button.button:focus {
    background-color: #333e48;
    color: #fff;
}

/* Product Meta */
.product_meta {
    margin-top: 2em;
    margin-bottom: 1.5em;
    font-size: 0.857em;
    color: #999;
}

.product_meta .sku_wrapper {
    display: block;
    margin-bottom: 0.5em;
}

.product_meta .sku {
    font-weight: 600;
    color: #333e48;
}

/* Social Share */
.electro-single-product-sharing {
    margin-top: 1.5em;
    padding-top: 1.5em;
    border-top: 1px solid #eeeeee;
}

.electro-single-product-sharing .social-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.electro-single-product-sharing .share-label {
    font-weight: 600;
    color: #333e48;
}

.electro-single-product-sharing a {
    color: #999;
    font-size: 1.2em;
    transition: color 0.3s ease;
}

.electro-single-product-sharing a:hover {
    color: #2563eb;
}

/* Woocommerce Tabs */
.woocommerce-tabs {
    margin-bottom: 4.857em;
}

.woocommerce-tabs .nav-tabs {
    border-bottom: 2px solid #dddddd;
    justify-content: center;
    margin-bottom: 0;
}

.woocommerce-tabs .nav-tabs .nav-item {
    margin-bottom: -2px;
}

.woocommerce-tabs .nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: #333e48;
    font-weight: 600;
    font-size: 1.071em;
    padding: 1em 1.786em;
    margin: 0;
    cursor: pointer;
}

.woocommerce-tabs .nav-tabs button.nav-link {
    border-radius: 0;
    background: transparent;
}

.woocommerce-tabs .nav-tabs .nav-link:hover {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.woocommerce-tabs .nav-tabs .nav-link.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: none;
}

.woocommerce-tabs .wc-tab {
    border-radius: 0;
    border: none;
    padding: 2.5em 0;
}

.woocommerce-tabs .wc-tab h2,
.woocommerce-tabs .wc-tab h3 {
    font-size: 1.357em;
    margin-bottom: 1.5em;
    font-weight: 600;
}

/* Shop Attributes Table */
table.shop_attributes {
    width: 100%;
    border: 1px solid #eeeeee;
}

table.shop_attributes tbody tr {
    border-bottom: 1px solid #eeeeee;
}

table.shop_attributes tbody tr:last-child {
    border-bottom: none;
}

table.shop_attributes tbody tr:nth-of-type(odd) {
    background-color: #fafafa;
}

table.shop_attributes th,
table.shop_attributes td {
    padding: 1em;
    vertical-align: top;
}

table.shop_attributes th {
    font-weight: 600;
    width: 30%;
    text-align: left;
}

table.shop_attributes td p {
    margin-bottom: 0;
}

/* Reviews */
#reviews .commentlist {
    list-style: none;
    padding: 0;
    margin: 0 0 2em 0;
}

#reviews .commentlist > li {
    padding: 2em 0;
    border-bottom: 1px solid #eeeeee;
}

#reviews .commentlist > li:last-child {
    border-bottom: none;
}

#reviews .comment-text .star-rating {
    width: 5.4em;
    height: 1em;
    margin-bottom: 0.5em;
}

#reviews .comment-text .meta {
    margin-bottom: 1em;
    color: #999;
    font-size: 0.857em;
}

#reviews .comment-text .meta strong {
    color: #333e48;
    font-size: 1.1em;
}

#reviews .comment-text .description {
    color: #666;
    line-height: 1.8em;
}

/* Review Form */
#review_form_wrapper {
    margin-top: 2em;
    padding-top: 2em;
    border-top: 1px solid #eeeeee;
}

#respond .comment-reply-title {
    font-size: 1.357em;
    margin-bottom: 1.5em;
    font-weight: 600;
}

#respond .comment-form label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 600;
}

#respond .comment-form .form-control,
#respond .comment-form .form-select {
    border: 1px solid #dddddd;
    border-radius: 0.571em;
    padding: 0.75em 1em;
}

#respond .comment-form textarea.form-control {
    resize: vertical;
}

#respond .form-submit .btn-primary {
    background-color: #2563eb;
    border-color: #2563eb;
    font-weight: bold;
    padding: 0.857em 2.857em;
    border-radius: 1.8em;
}

#respond .form-submit .btn-primary:hover {
    background-color: #333e48;
    border-color: #333e48;
}

/* Related Products */
section.related {
    margin-bottom: 4.857em;
}

section.related > h2 {
    font-size: 1.786em;
    line-height: 1.4em;
    margin-bottom: 1.5em;
    padding-bottom: 0.8em;
    border-bottom: 1px solid #dddddd;
    position: relative;
    font-weight: 600;
}

section.related > h2::after {
    content: ' ';
    width: 83px;
    border-bottom: 2px solid #2563eb;
    display: block;
    position: absolute;
    bottom: -1px;
}

section.related ul.products {
    margin-bottom: 0;
}

section.related .product .product-inner {
    padding: 1.071em;
}

/* Woocommerce Product Gallery */
.woocommerce-product-gallery,
.electro-wc-product-gallery {
    position: relative;
}

.woocommerce-product-gallery .flex-viewport {
    margin-bottom: 0.857em;
}

.woocommerce-product-gallery .flex-viewport figure {
    margin-bottom: 0;
}

.woocommerce-product-gallery img {
    width: 100%;
    height: auto;
    display: block;
}

/* Thumbnails */
.flex-control-thumbs,
.electro-wc-product-gallery__wrapper {
    margin: 0 -5px;
    padding: 0;
    display: flex;
    flex-flow: row wrap;
}

.flex-control-thumbs .electro-wc-product-gallery__image,
.flex-control-thumbs li {
    list-style: none;
    cursor: pointer;
    padding: 5px;
    width: 25%;
}

.flex-control-thumbs img {
    border: 1px solid #f5f6f8;
    margin: auto;
    width: 100%;
    transition: border-color 0.3s ease;
}

.flex-control-thumbs img:hover,
.flex-control-thumbs img.flex-active {
    border-bottom-width: 2px;
    border-bottom-color: #2563eb;
}

/* Sale Badge */
.product-images-wrapper .onsale {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
    background-color: #ff0000;
    color: #fff;
    padding: 2px 4px;
    border-radius: 0px !important;
    -webkit-border-radius: 0px !important;
    -moz-border-radius: 0px !important;
    font-weight: bold;
    font-size: 10px;
    line-height: 1;
    min-height: 0;
    max-height: 20px;
    box-sizing: border-box;
    overflow: hidden;
}

/* Variation Display */
.woocommerce-variation.single_variation {
    margin-top: 1.786em;
    margin-bottom: 1em;
}

.woocommerce-variation-add-to-cart {
    margin-top: 1em;
}

.variations_button {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    flex-wrap: wrap;
}

/* Responsive Adjustments */
@media (max-width: 767px) {
    .product_title.entry-title {
        font-size: 1.5em;
    }
    
    .summary .price {
        font-size: 2em;
    }
    
    .flex-control-thumbs .electro-wc-product-gallery__image,
    .flex-control-thumbs li {
        width: 25%;
    }
    
    .single_add_to_cart_button.button {
        width: 100%;
        margin-top: 10px;
    }
    
    .variations_button {
        flex-direction: column;
        align-items: stretch;
    }
    
    .quantity {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* Breadcrumb */
.woocommerce-breadcrumb {
    margin-bottom: 2em;
    font-size: 0.857em;
    color: #999;
}

.woocommerce-breadcrumb a {
    color: #999;
    text-decoration: none;
}

.woocommerce-breadcrumb a:hover {
    color: #2563eb;
}

.woocommerce-breadcrumb .delimiter {
    margin: 0 0.5em;
    color: #ddd;
}

