/* ========================================
   CUSTOM SHOP PAGE STYLES - EYEGLASSES
   ======================================== */

/* Make WooCommerce pages full width - Remove container/padding */
.woocommerce-page .site-content,
.woocommerce .site-content,
.woocommerce-page .content-area,
.woocommerce .content-area,
.woocommerce-page #primary,
.woocommerce #primary,
.woocommerce-page .container,
.woocommerce .container,
.woocommerce-page main,
.woocommerce main {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0 !important;
    
}

.woocommerce-js .woocommerce-breadcrumb {
    zoom: 1;
    margin: 0 0 1em;
    padding: 0;
    font-size: .92em;
    color: #777;
    display: none !important;
}

/* Center and control width of Astra WooCommerce container */
.ast-woocommerce-container {
    max-width: 1600px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 20px 0px !important;
}

/* Responsive for large screens */
@media (min-width: 1600px) {
    .ast-woocommerce-container {
        max-width: 1800px !important;
        padding: 20px 0px !important;
    }
    
    .eyeglasses-category-page {
        max-width: 1800px !important;
    }
    
    .subcategory-products-page {
        max-width: 1800px !important;
    }
    
    .custom-shop-categories {
        max-width: 1400px !important;
    }
}

@media (min-width: 1920px) {
    .ast-woocommerce-container {
        max-width: 2000px !important;
        padding: 20px 0px !important;
    }
    
    .eyeglasses-category-page {
        max-width: 2000px !important;
    }
    
    .subcategory-products-page {
        max-width: 2000px !important;
    }
}

/* Remove background and make full width */
.woocommerce,
.woocommerce-page {
    background: #fff !important;
}

/* Hide sidebar on shop pages */
.woocommerce-page .sidebar,
.woocommerce .sidebar,
.woocommerce-page aside,
.woocommerce aside {
    display: none !important;
}

/* Main Shop Page - Category Cards */
.custom-shop-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.main-category-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.main-category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.main-category-card .category-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.main-category-card .category-image-wrapper {
    width: 100%;
    height: 300px;
    overflow: hidden;
    background: #f5f5f5;
}

.main-category-card .category-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.main-category-card:hover .category-image-wrapper img {
    transform: scale(1.05);
}

.main-category-card .category-title {
    padding: 20px;
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    color: #2d5a4d;
}

/* Eyeglasses Category Page */
.eyeglasses-category-page {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 0px 40px;
}

/* Style ALL WooCommerce Category Headers with Green Bar - GLOBAL */
.woocommerce-products-header {
    background: linear-gradient(135deg, #2d5a4d 0%, #3d6b5c 100%) !important;
    padding: 20px 0px !important;
    text-align: center !important;
    margin-bottom: 40px !important;
    border-radius: 0 !important;
    display: block !important;
}

.woocommerce-products-header__title.page-title,
.page-title {
    color: #fff !important;
    margin: 0 !important;
    font-size: 36px !important;
    font-weight: 700 !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
    display: block !important;
}

/* Hide breadcrumbs in the header if needed */
.woocommerce-products-header .woocommerce-breadcrumb {
    display: none !important;
}

/* If the header is hidden by theme, force it to show */
.woocommerce-products-header {
    opacity: 1 !important;
    visibility: visible !important;
    height: 85px !important;
}

/* Hide the subcategory page title (small title under green bar) */
.subcategory-page-title {
    display: none !important;
}

/* Subcategory Section */
.subcategory-section {
    margin-bottom: 60px;
}

.subcategory-title {
    font-size: 54px;
    color: #CBAD8B;
    font-weight: 500;
    margin: 0 0 30px 0;
    padding-bottom: 10px;
}

/* Products Grid - Centered with 4 columns - LARGER CARDS (Category page only) */
.eyeglasses-category-page .products-grid {
    display: grid;
    grid-template-columns: repeat(4, 310px);
    gap: 15px;
    margin-bottom: 30px;
    justify-content: center;
}

@media (max-width: 1400px) {
    .eyeglasses-category-page .products-grid {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1300px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 768px) {
    .eyeglasses-category-page .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* Product Card - LARGER SIZE 310x405 (Category page only) */
.eyeglasses-category-page .product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 310px;
    height: auto;
    min-height: 405px;
}

@media (max-width: 1400px) {
    .eyeglasses-category-page .product-card {
        width: 100%;
        min-height: auto;
    }
}

.eyeglasses-category-page .product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.eyeglasses-category-page .product-image-wrapper {
    width: 100%;
    height: 310px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1400px) {
    .eyeglasses-category-page .product-image-wrapper {
        height: auto;
        aspect-ratio: 1;
    }
}

/* Subcategory Products Page - Keep OLD SIZE */
.subcategory-products-page .product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.subcategory-products-page .product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.subcategory-products-page .product-image-wrapper {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: linear-gradient(135deg, #d4e9e2 0%, #b8d5cc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-wrapper a {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.eyeglasses-category-page .product-card:hover .product-image-wrapper img,
.subcategory-products-page .product-card:hover .product-image-wrapper img {
    transform: scale(1.05);
}

/* Product Info - Category page with better spacing */
.eyeglasses-category-page .product-info {
    padding: 15px;
    text-align: left;
    min-height: 95px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

@media (max-width: 1400px) {
    .eyeglasses-category-page .product-info {
        min-height: auto;
    }
}

/* Product Info - Subcategory page regular */
.subcategory-products-page .product-info {
    padding: 15px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.3;
    /* Allow text to wrap to 2 lines if needed */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.product-price .amount {
    font-weight: 600;
    color: #2d5a4d;
}

.see-details {
    color: #888;
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s ease;
    margin-top: auto;
}

.see-details:hover {
    color: #2d5a4d;
}

/* View All Button */
.view-all-btn {
    display: inline-block;
    padding: 12px 40px;
    border: 3px solid #375D50;
    color: #375D50;
    text-decoration: none;
    border-radius: 100px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.view-all-btn:hover {
    background: #2d5a4d;
    color: #fff;
}

/* Subcategory Products Page */
.subcategory-products-page {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

/* Sort by filter styling */
.woocommerce-ordering {
    margin: 0 0 30px 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.woocommerce-ordering select {
    padding: 10px 40px 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    background-color: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
}

.woocommerce-ordering select:hover {
    border-color: #2d5a4d;
}

.woocommerce-ordering select:focus {
    outline: none;
    border-color: #2d5a4d;
    box-shadow: 0 0 0 2px rgba(45, 90, 77, 0.1);
}

.subcategory-page-title {
    font-size: 28px;
    color: #c4a57b;
    font-weight: 400;
    margin: 30px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

/* Override default WooCommerce product list styles when in subcategory view */
.subcategory-products-page .woocommerce-loop-product__title {
    font-size: 16px;
    font-weight: 600;
}

.subcategory-products-page .products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

/* Large screens - more products per row */
@media (min-width: 1600px) {
    .subcategory-products-page .products {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 30px;
    }
}

@media (min-width: 1920px) {
    .subcategory-products-page .products {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 35px;
    }
}

/* Pagination */
.custom-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 50px;
    padding: 20px 0;
}

.custom-pagination .page-link {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.custom-pagination .page-link:hover {
    color: #2d5a4d;
}

.custom-pagination .page-numbers {
    display: flex;
    gap: 10px;
    align-items: center;
}

.custom-pagination .page-numbers .current {
    font-weight: 700;
    color: #2d5a4d;
}

.custom-pagination .page-numbers a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.custom-pagination .page-numbers a:hover {
    color: #2d5a4d;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .woocommerce-products-header__title.page-title,
    .page-title {
        font-size: 30px !important;
    }
    
    .subcategory-title {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .woocommerce-products-header {
        padding: 25px 15px !important;
    }
    
    .woocommerce-products-header__title.page-title,
    .page-title {
        font-size: 24px !important;
        letter-spacing: 1px !important;
    }
    
    .subcategory-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .view-all-btn {
        padding: 10px 30px;
        font-size: 14px;
    }
    
    .custom-pagination {
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .product-name {
        font-size: 14px;
    }
    
    .product-price {
        font-size: 12px;
    }
    
    .see-details {
        font-size: 12px;
    }
}
