/* Complete Provisions - Single Product Styles */

.product-single {
    padding: var(--spacing-xl) 0;
}

.product-single-container {
    width: 100%;
}

.product-single-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
}

@media (min-width: 768px) {
    .product-single-grid {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

@media (min-width: 1024px) {
    .product-single-grid {
        grid-template-columns: 55% 45%;
    }
}

/* Product Gallery */
.product-gallery {
    position: sticky;
    top: calc(var(--header-height, 70px) + var(--spacing-lg));
}

.product-gallery .woocommerce-product-gallery {
    background-color: var(--color-surface);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.product-gallery .woocommerce-product-gallery__wrapper {
    position: relative;
}

.product-gallery .woocommerce-product-gallery__image {
    display: block;
    width: 100%;
}

.product-gallery .woocommerce-product-gallery__image a {
    display: block;
}

.product-gallery .woocommerce-product-gallery__image img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* Gallery Thumbnails */
.product-gallery .flex-control-thumbs,
.product-gallery .woocommerce-product-gallery__wrapper + .flex-control-thumbs {
    display: flex !important;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    padding: 0 var(--spacing-sm);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.product-gallery .flex-control-thumbs li {
    flex: 0 0 auto;
    scroll-snap-align: start;
}

.product-gallery .flex-control-thumbs img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: var(--border-width) solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    opacity: 0.6;
}

.product-gallery .flex-control-thumbs img:hover,
.product-gallery .flex-control-thumbs img.flex-active {
    opacity: 1;
    border-color: var(--color-primary);
}

/* Product Summary */
.product-summary {
    padding: var(--spacing-lg);
    background-color: var(--color-surface);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius-lg);
}

@media (min-width: 768px) {
    .product-summary {
        position: sticky;
        top: calc(var(--header-height, 70px) + var(--spacing-lg));
    }
}

.product-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: var(--border-width) solid var(--color-border);
}

.product-brand-label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
}

.product-brand-name {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
}

.product-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-heading);
    color: var(--color-text-heading);
    margin: 0 0 var(--spacing-md);
}

@media (min-width: 768px) {
    .product-title {
        font-size: var(--font-size-3xl);
    }
}

.product-sku {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.product-sku .sku-label {
    font-weight: var(--font-weight-medium);
}

.product-sku .sku-value {
    font-family: var(--font-family-mono);
}

.product-categories,
.product-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.product-categories .categories-label,
.product-tags .tags-label {
    font-weight: var(--font-weight-medium);
}

.product-categories a,
.product-tags a {
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

.product-categories a:hover,
.product-categories a:focus,
.product-tags a:hover,
.product-tags a:focus {
    color: var(--color-primary);
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: var(--border-width) solid var(--color-border);
}

.product-price .price {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-xs);
}

.product-price .woocommerce-Price-amount {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
}

@media (min-width: 768px) {
    .product-price .woocommerce-Price-amount {
        font-size: var(--font-size-3xl);
    }
}

.product-price del {
    opacity: 0.6;
    font-size: var(--font-size-lg);
}

.product-price ins {
    text-decoration: none;
    color: var(--color-error);
}

.product-short-description {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: var(--border-width) solid var(--color-border);
    line-height: var(--line-height-base);
    color: var(--color-text);
}

.product-short-description p:last-child {
    margin-bottom: 0;
}

/* Add to Cart Form */
.product-add-to-cart-form {
    margin-bottom: var(--spacing-xl);
}

.product-add-to-cart-form .cart {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-md);
}

.product-add-to-cart-form .quantity {
    display: flex;
    align-items: center;
    margin: 0;
}

.product-add-to-cart-form .quantity label {
    display: none;
}

.product-add-to-cart-form .qty {
    width: 80px;
    height: 48px;
    padding: 0 var(--spacing-md);
    text-align: center;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius-md);
    -moz-appearance: textfield;
}

.product-add-to-cart-form .qty::-webkit-outer-spin-button,
.product-add-to-cart-form .qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.product-add-to-cart-form .button {
    flex: 1;
    min-width: 200px;
    height: 48px;
    padding: 0 var(--spacing-xl);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
}

.product-add-to-cart-form .button.single_add_to_cart_button {
    background-color: var(--color-primary);
    color: var(--color-on-primary);
}

.product-add-to-cart-form .button.single_add_to_cart_button:hover,
.product-add-to-cart-form .button.single_add_to_cart_button:focus {
    background-color: var(--color-primary-hover);
}

.product-add-to-cart-form .button.disabled,
.product-add-to-cart-form .button:disabled {
    background-color: var(--color-border);
    color: var(--color-text-muted);
    cursor: not-allowed;
}

/* Stock Status */
.product-add-to-cart-form .stock {
    display: block;
    margin-top: var(--spacing-sm);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.product-add-to-cart-form .stock.in-stock {
    color: var(--color-success);
}

.product-add-to-cart-form .stock.out-of-stock {
    color: var(--color-error);
}

.product-add-to-cart-form .stock.low-stock {
    color: var(--color-warning);
}

/* Trust Indicators */
.product-trust-indicators {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: var(--border-width) solid var(--color-border);
}

.trust-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex: 1;
    min-width: 140px;
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--color-background-alt);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.trust-item svg {
    flex-shrink: 0;
    color: var(--color-primary);
}

/* Product Meta */
.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    padding-top: var(--spacing-lg);
    border-top: var(--border-width) solid var(--color-border);
}

.product-meta > div {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.product-meta .meta-label {
    font-weight: var(--font-weight-medium);
}

.product-meta a {
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

.product-meta a:hover,
.product-meta a:focus {
    color: var(--color-primary);
}

/* Product Details (Tabs) */
.product-details {
    background-color: var(--color-surface);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.product-details .wc-tabs {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
    border-bottom: var(--border-width) solid var(--color-border);
    background-color: var(--color-background-alt);
}

.product-details .wc-tabs li {
    margin: 0;
}

.product-details .wc-tabs a {
    display: block;
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: calc(var(--border-width) * -1);
    transition: all var(--transition-fast);
}

.product-details .wc-tabs a:hover,
.product-details .wc-tabs a:focus {
    color: var(--color-primary);
    background-color: var(--color-background);
}

.product-details .wc-tabs li.active a {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background-color: var(--color-surface);
}

.product-details .wc-tab {
    display: none;
    padding: var(--spacing-xl);
}

.product-details .wc-tab.active {
    display: block;
    animation: fadeIn var(--transition-fast);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-details .wc-tab h2 {
    font-size: var(--font-size-xl);
    margin-top: 0;
    margin-bottom: var(--spacing-md);
}

.product-details .wc-tab p {
    margin-bottom: var(--spacing-md);
}

.product-details .wc-tab p:last-child {
    margin-bottom: 0;
}

/* Product Attributes Table */
.product-details .woocommerce-product-attributes {
    width: 100%;
    border-collapse: collapse;
}

.product-details .woocommerce-product-attributes th,
.product-details .woocommerce-product-attributes td {
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: var(--border-width) solid var(--color-border);
    text-align: left;
}

.product-details .woocommerce-product-attributes th {
    width: 30%;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-heading);
    background-color: var(--color-background-alt);
}

.product-details .woocommerce-product-attributes td {
    color: var(--color-text);
}

.product-details .woocommerce-product-attributes tr:last-child th,
.product-details .woocommerce-product-attributes tr:last-child td {
    border-bottom: none;
}

/* Related Products */
.related-products {
    margin-top: var(--spacing-2xl);
}

.related-products h2 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    margin: 0 0 var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: var(--border-width) solid var(--color-border);
}

.related-products .products {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--spacing-lg);
}

@media (min-width: 414px) {
    .related-products .products {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .related-products .products {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .related-products .products {
        grid-template-columns: repeat(4, 1fr);
    }
}

.related-products .product-card {
    height: 100%;
}

/* Upsells */
.upsells.products {
    margin-top: var(--spacing-2xl);
}

.upsells.products h2 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    margin: 0 0 var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: var(--border-width) solid var(--color-border);
}

/* Responsive */
@media (max-width: 768px) {
    .product-single {
        padding: var(--spacing-lg) 0;
    }
    
    .product-single-grid {
        gap: var(--spacing-lg);
    }
    
    .product-gallery {
        position: static;
    }
    
    .product-summary {
        position: static;
    }
    
    .product-title {
        font-size: var(--font-size-xl);
    }
    
    .product-price .woocommerce-Price-amount {
        font-size: var(--font-size-xl);
    }
    
    .product-add-to-cart-form .cart {
        flex-direction: column;
        align-items: stretch;
    }
    
    .product-add-to-cart-form .button {
        width: 100%;
    }
    
    .trust-item {
        flex: 1 1 calc(50% - var(--spacing-sm));
        min-width: auto;
    }
}

@media (max-width: 414px) {
    .related-products .products {
        grid-template-columns: 1fr;
    }
    
    .trust-item {
        flex: 1 1 100%;
    }
}