/**
 * WooCommerce Shop/Archive Page Styles
 * Apple-inspired shop and product grid styling
 * 
 * @package Mason
 */

/* ============================================
   SHOP PAGE
   ============================================ */
.mason-shop-page,
.woocommerce-shop {
    margin: 0 auto;
    padding: 60px 22px 80px;
    background: #f5f5f7;
    min-width: 100%;
}

/* Shop Header */
.shop-header {
    text-align: center;
    margin-bottom: 60px;
}

.shop-title,
.woocommerce-products-header__title {
    font-size: 48px;
    font-weight: 600;
    line-height: 1.08349;
    letter-spacing: -0.003em;
    color: #1d1d1f;
    margin-bottom: 12px;
}

.shop-description {
    font-size: 17px;
    line-height: 1.47059;
    color: #86868b;
}

/* Category Section */
.category-section {
    max-width: 1024px;
    margin: 0 auto;
    padding: 40px 22px;
    background: #ffffff;
    border-radius: 18px;
    margin-bottom: 40px;
}

.category-section h2 {
    font-size: 32px;
    font-weight: 600;
    line-height: 1.125;
    letter-spacing: 0.004em;
    color: #1d1d1f;
    margin: 0 0 30px 0;
}

/* Category Navigation */
.mason-category-nav {
    background: #ffffff;
    padding: 40px 0;
    margin-bottom: 0;
}

.mason-category-nav-container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 22px;
}

.mason-category-nav-scroll {
    position: relative;
    overflow: hidden;
}

.mason-category-list {
    display: flex;
    gap: 20px;
    list-style: none;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 20px 0;
    margin: 0;
}

.mason-category-list::-webkit-scrollbar {
    display: none;
}

.mason-category-item {
    flex: 0 0 auto;
    width: 180px;
}

.mason-category-item.active .mason-category-link {
    opacity: 1;
}

.mason-category-item.active .mason-category-image {
    border: 2px solid #8da3d4;
}

.mason-category-link {
    display: block;
    text-decoration: none;
    text-align: center;
    transition: opacity 0.3s ease;
}

.mason-category-link:hover {
    opacity: 0.7;
}

.mason-category-image {
    width: 100%;
    height: 180px;
    background: #f5f5f7;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.mason-category-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mason-category-label {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.42859;
    color: #1d1d1f;
    margin: 0;
}

.mason-category-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.42859;
    color: #1d1d1f;
    margin: 0;
}

.mason-category-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 4px;
    background-color: rgba(255, 149, 0, 0.1);
    color: #ff9500;
}

/* Paddle Navigation */
.mason-paddlenav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #d2d2d7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.mason-paddlenav:hover {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mason-paddlenav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.mason-paddlenav-left {
    left: -22px;
}

.mason-paddlenav-right {
    right: -22px;
}

.mason-paddlenav-icon {
    width: 20px;
    height: 20px;
    fill: #1d1d1f;
}

/* Legacy paddle class names for backward compatibility */
.mason-category-nav-paddle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #d2d2d7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.mason-category-nav-paddle:hover {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mason-category-nav-paddle:disabled,
.mason-category-nav-paddle.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.mason-category-nav-paddle-left {
    left: -22px;
}

.mason-category-nav-paddle-right {
    right: -22px;
}

.mason-category-nav-paddle svg {
    width: 20px;
    height: 20px;
    fill: #1d1d1f;
}

/* Products Grid Container */
.products-container {
    max-width: 1024px;
    margin: 0 auto;
}

.products-grid-container {
    margin-top: 40px;
}

/* Product Grid */
.products-grid,
.wc-block-grid__products,
.wp-block-query {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Product Card */
.mason-product-card,
.wc-block-grid__product,
.wp-block-post {
    background: #ffffff;
    border-radius: 18px;
    padding: 30px;
    box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.078);
    transition: all 0.3s cubic-bezier(0, 0, 0.5, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    text-decoration: none;
    color: #1d1d1f;
}

.mason-product-card:hover,
.wc-block-grid__product:hover,
.wp-block-post:hover {
    transform: translateY(-4px);
    box-shadow: 2px 8px 24px rgba(0, 0, 0, 0.12);
}

/* Product Badges */
.mason-product-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    min-height: 20px;
}

.mason-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 8px;
}

.mason-badge-new {
    background-color: rgba(255, 149, 0, 0.1);
    color: #ff9500;
}

.mason-badge-sale {
    background-color: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
}

/* Product Image */
.mason-product-image,
.mason-product-image-wrapper,
.wc-block-grid__product-image,
.wp-block-post-featured-image {
    width: 100%;
    aspect-ratio: 1;
    background: #f5f5f7;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
}

.mason-product-image img,
.mason-product-image-wrapper img,
.wc-block-grid__product-image img,
.wp-block-post-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.mason-product-card:hover .mason-product-image img,
.mason-product-card:hover .mason-product-image-wrapper img,
.wc-block-grid__product:hover .wc-block-grid__product-image img,
.wp-block-post:hover .wp-block-post-featured-image img {
    transform: scale(1.05);
}

/* Color Swatches */
.mason-product-colors {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    min-height: 24px;
}

.mason-color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mason-color-swatch:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mason-color-swatch.active {
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #0071e3;
}

/* Product Title */
.mason-product-title,
.wc-block-grid__product-title,
.wp-block-post-title {
    font-size: 21px;
    font-weight: 600;
    line-height: 1.19048;
    letter-spacing: 0.011em;
    color: #1d1d1f;
    margin: 0 0 8px 0;
}

.mason-product-title a,
.wc-block-grid__product-title a,
.wp-block-post-title a {
    color: #1d1d1f;
    text-decoration: none;
}

.mason-product-title a:hover,
.wc-block-grid__product-title a:hover,
.wp-block-post-title a:hover {
    color: #1d1d1f;
}

/* Product Description */
.mason-product-description {
    font-size: 14px;
    line-height: 1.42859;
    color: #86868b;
    margin-bottom: 16px;
    flex: 1;
}

/* Product Price */
.mason-product-price,
.wc-block-grid__product-price {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.23536;
    letter-spacing: -0.022em;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.mason-product-price .woocommerce-Price-amount,
.mason-product-price .amount,
.wc-block-grid__product-price .amount {
    color: #1d1d1f;
    font-weight: 600;
}

.mason-product-price-from {
    font-size: 14px;
    color: #86868b;
}

.mason-product-installment {
    font-size: 12px;
    color: #86868b;
    margin-top: 4px;
}

/* Product Results Count & Sorting */
.woocommerce-result-count,
.woocommerce-ordering {
    font-size: 14px;
    color: #86868b;
    margin-bottom: 20px;
}

.woocommerce-ordering select {
    padding: 8px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #ffffff;
    color: #1d1d1f;
}

.woocommerce-ordering select:focus {
    outline: none;
    border-color: #8da3d4;
}

/* Responsive */
@media (min-width: 735px) and (max-width: 1068px) {
    .products-grid,
    .wc-block-grid__products,
    .wp-block-query {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .mason-category-item {
        width: 150px;
    }
    
    .mason-category-image {
        height: 150px;
    }
}

@media (max-width: 734px) {
    .mason-shop-page,
    .woocommerce-shop {
        padding: 30px 16px 50px;
    }
    
    .shop-title,
    .woocommerce-products-header__title {
        font-size: 32px;
    }
    
    .products-grid,
    .wc-block-grid__products,
    .wp-block-query {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .category-section {
        padding: 24px 16px;
    }
    
    .category-section h2 {
        font-size: 28px;
    }
    
    .mason-category-item {
        width: 120px;
    }
    
    .mason-category-image {
        height: 120px;
    }
    
    .mason-paddlenav,
    .mason-category-nav-paddle {
        display: none;
    }
}
