/**
 * Sonnex WooCommerce Styles
 * 
 * Enhanced styling for Archive and Single Product pages.
 */

/* =============================================================================
   SHOP ARCHIVE - HEADER
   ============================================================================= */

.sonnex-shop-header {
    background: linear-gradient(180deg, #f8f8f8 0%, #ffffff 100%);
    padding: 4rem 0 3rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 3rem;
}

.sonnex-shop-header__inner {
    max-width: 600px;
}

.sonnex-shop-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    margin: 0 0 1rem;
    text-transform: uppercase;
}

.sonnex-shop-description p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* =============================================================================
   SHOP ARCHIVE - LAYOUT
   ============================================================================= */

.sonnex-shop-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 4rem;
    margin-bottom: 6rem;
}

@media (max-width: 1024px) {
    .sonnex-shop-layout {
        grid-template-columns: 1fr;
    }
}

/* =============================================================================
   SHOP ARCHIVE - SIDEBAR
   ============================================================================= */

.sonnex-shop-sidebar {
    position: relative;
}

.sonnex-shop-sidebar__sticky {
    position: sticky;
    top: 100px;
}

.sonnex-shop-sidebar__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--color-primary);
}

.sonnex-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-primary);
}

/* Widget Styling */
.sonnex-shop-sidebar .widget {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-subtle);
}

.sonnex-shop-sidebar .widget:last-child {
    border-bottom: none;
}

.sonnex-shop-sidebar .widget-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.sonnex-shop-sidebar .widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sonnex-shop-sidebar .widget ul li {
    margin-bottom: 0.75rem;
}

.sonnex-shop-sidebar .widget ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.2s;
}

.sonnex-shop-sidebar .widget ul li a:hover {
    color: var(--color-accent);
}

/* =============================================================================
   SHOP ARCHIVE - TOOLBAR
   ============================================================================= */

.sonnex-shop-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
    background: #f8f8f8;
    border-radius: 4px;
}

.woocommerce-result-count {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin: 0;
}

.woocommerce-ordering select {
    border: 1px solid var(--border-medium);
    padding: 0.5rem 2rem 0.5rem 1rem;
    font-size: 0.875rem;
    background: white;
    border-radius: 4px;
    cursor: pointer;
}

.sonnex-view-toggle {
    display: flex;
    gap: 0.5rem;
}

.sonnex-view-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-medium);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sonnex-view-btn:hover,
.sonnex-view-btn.is-active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

/* =============================================================================
   SHOP ARCHIVE - PRODUCT GRID
   ============================================================================= */

.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    background: transparent;
    border: none;
    margin: 0;
    padding: 0;
}

.woocommerce ul.products li.product {
    background: white;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    overflow: hidden;
    padding: 0;
    position: relative;
    transition: all 0.3s ease;
}

.woocommerce ul.products li.product:hover {
    border-color: var(--color-primary);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

/* Product Image */
.woocommerce ul.products li.product a img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    margin: 0;
    border-bottom: 1px solid var(--border-subtle);
}

/* Product Info */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 1rem;
    font-weight: 600;
    padding: 1.25rem 1.25rem 0.5rem;
    margin: 0;
    color: var(--text-primary);
}

.woocommerce ul.products li.product .price {
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    color: var(--color-accent);
    padding: 0 1.25rem 1.25rem;
    display: block;
}

/* Add to Cart Button */
.woocommerce ul.products li.product .button {
    width: calc(100% - 2.5rem);
    margin: 0 1.25rem 1.25rem;
    border-radius: 4px;
    padding: 0.875rem 1.5rem;
    font-size: 0.8125rem;
}

/* =============================================================================
   SHOP ARCHIVE - PAGINATION
   ============================================================================= */

.woocommerce nav.woocommerce-pagination {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-subtle);
}

.woocommerce nav.woocommerce-pagination ul {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-medium);
    background: white;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    transition: all 0.2s;
}

.woocommerce nav.woocommerce-pagination ul li a:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.woocommerce nav.woocommerce-pagination ul li span.current {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

/* =============================================================================
   SINGLE PRODUCT - LAYOUT
   ============================================================================= */

.sonnex-product-single {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 5rem;
    margin: 3rem 0;
}

@media (max-width: 1024px) {
    .sonnex-product-single {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

/* =============================================================================
   SINGLE PRODUCT - GALLERY
   ============================================================================= */

.sonnex-product-media {
    position: relative;
}

.sonnex-product-media .woocommerce-product-gallery {
    margin: 0;
}

.sonnex-product-media .woocommerce-product-gallery__image img {
    width: 100%;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}

.sonnex-product-media .flex-control-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
    list-style: none;
    padding: 0;
}

.sonnex-product-media .flex-control-thumbs li img {
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: border-color 0.2s;
}

.sonnex-product-media .flex-control-thumbs li img:hover,
.sonnex-product-media .flex-control-thumbs li img.flex-active {
    border-color: var(--color-primary);
}

/* =============================================================================
   SINGLE PRODUCT - INFO
   ============================================================================= */

.sonnex-product-info {
    position: relative;
}

.sonnex-product-info__sticky {
    position: sticky;
    top: 100px;
}

.sonnex-product-header {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-subtle);
}

.sonnex-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 2px;
    margin-bottom: 1rem;
}

.sonnex-badge--sale {
    background: var(--color-accent);
    color: white;
}

.sonnex-product-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0 0 1rem;
}

.sonnex-product-price {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--color-accent);
}

.sonnex-product-price del {
    color: var(--text-tertiary);
    font-size: 1rem;
    margin-right: 0.5rem;
}

.sonnex-product-excerpt {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* =============================================================================
   SINGLE PRODUCT - ACTIONS
   ============================================================================= */

.sonnex-product-actions {
    margin-bottom: 2rem;
}

.sonnex-product-actions form.cart {
    display: flex;
    gap: 1rem;
    align-items: stretch;
}

.sonnex-product-actions .quantity {
    width: 100px;
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    overflow: hidden;
}

.sonnex-product-actions .quantity input {
    width: 100%;
    height: 100%;
    border: none;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    padding: 0 1rem;
}

.sonnex-product-actions .single_add_to_cart_button {
    flex: 1;
    border-radius: 4px;
}

/* =============================================================================
   SINGLE PRODUCT - META
   ============================================================================= */

.sonnex-product-meta {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-subtle);
}

.sonnex-product-meta .sku_wrapper,
.sonnex-product-meta .posted_in,
.sonnex-product-meta .tagged_as {
    display: block;
    margin-bottom: 0.5rem;
}

.sonnex-product-meta a {
    color: var(--text-secondary);
    text-decoration: none;
}

.sonnex-product-meta a:hover {
    color: var(--color-accent);
}

/* =============================================================================
   SINGLE PRODUCT - ACCORDIONS
   ============================================================================= */

.sonnex-product-accordions {
    border-top: 1px solid var(--border-subtle);
}

.sonnex-accordion-item {
    border-bottom: 1px solid var(--border-subtle);
}

.sonnex-accordion-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
    transition: color 0.2s;
}

.sonnex-accordion-toggle:hover {
    color: var(--color-accent);
}

.sonnex-accordion-toggle .icon {
    font-size: 1.25rem;
    font-weight: 300;
    transition: transform 0.3s;
}

.sonnex-accordion-item.is-open .sonnex-accordion-toggle .icon {
    transform: rotate(45deg);
}

.sonnex-accordion-content {
    display: none;
    padding: 0 0 1.5rem;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.sonnex-accordion-item.is-open .sonnex-accordion-content {
    display: block;
}

/* =============================================================================
   SINGLE PRODUCT - RELATED
   ============================================================================= */

.woocommerce .related.products {
    margin-top: 6rem;
    padding-top: 4rem;
    border-top: 1px solid var(--border-subtle);
}

.woocommerce .related.products>h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

/* =============================================================================
   REVIEWS
   ============================================================================= */

#reviews .woocommerce-Reviews-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

#reviews .commentlist {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
}

#reviews .commentlist li {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

#reviews .comment_container {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 1rem;
}

#reviews .avatar {
    border-radius: 50%;
}

#reviews .star-rating {
    margin-bottom: 0.5rem;
}

#reviews .meta {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

#reviews .description p {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

/* Review Form */
#review_form_wrapper {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
}

#review_form .comment-form-rating label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

#review_form textarea {
    width: 100%;
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    padding: 1rem;
    font-size: 0.9375rem;
    resize: vertical;
    min-height: 120px;
}

#review_form input[type="text"],
#review_form input[type="email"] {
    width: 100%;
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
}

#review_form .form-submit input {
    margin-top: 1rem;
}