/* ==========================================================================
   Custom Shop Layout Styles
   ========================================================================== */

/* Product Zoom Out Animation */
@keyframes productZoomOut {
    0% {
        opacity: 0;
        transform: scale(1.15);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.product-card {
    opacity: 0;
    overflow: hidden;
}

.product-card.animate-in {
    opacity: 1;
    transition: opacity 0.6s ease-out;
}

.product-card .product-card-inner {
    transform: scale(1.15);
}

.product-card.animate-in .product-card-inner {
    animation: productZoomOut 0.6s ease-out forwards;
}

/* Stagger animation delays for sequential effect */
.product-card.animate-in:nth-child(1) .product-card-inner { animation-delay: 0.05s; }
.product-card.animate-in:nth-child(2) .product-card-inner { animation-delay: 0.1s; }
.product-card.animate-in:nth-child(3) .product-card-inner { animation-delay: 0.15s; }
.product-card.animate-in:nth-child(4) .product-card-inner { animation-delay: 0.2s; }
.product-card.animate-in:nth-child(5) .product-card-inner { animation-delay: 0.25s; }
.product-card.animate-in:nth-child(6) .product-card-inner { animation-delay: 0.3s; }
.product-card.animate-in:nth-child(7) .product-card-inner { animation-delay: 0.35s; }
.product-card.animate-in:nth-child(8) .product-card-inner { animation-delay: 0.4s; }
.product-card.animate-in:nth-child(9) .product-card-inner { animation-delay: 0.45s; }
.product-card.animate-in:nth-child(10) .product-card-inner { animation-delay: 0.5s; }
.product-card.animate-in:nth-child(11) .product-card-inner { animation-delay: 0.55s; }
.product-card.animate-in:nth-child(12) .product-card-inner { animation-delay: 0.6s; }

/* Shop Wrapper */
.custom-shop-wrapper {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0 !important;
    position: relative;
    margin-top: 100px;
}

.post-type-archive .main-content{
    padding: 0 !important;
}

.site-content,
.main-page-wrapper,
.container,
.woocommerce {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Shop Toolbar */
.shop-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e0e0e0;
    margin-bottom: 0;
    background: white;
    margin-top: 40px;
}

/* Filters Toggle Button */
.filters-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: none;
    padding: 20px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.2s ease;
    color: #333;
}

#filtersToggle{
    background-color: #fff;
    border-right: 1px solid #e0e0e0;
    padding: 20px;
}

.filters-toggle:hover {
    opacity: 0.7;
}

.filters-toggle svg {
    width: 14px;
    height: 14px;
}

/* Sort Toggle Button */
.sort-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.2s ease;
    color: #333;
}

.sort-toggle:hover {
    opacity: 0.7;
}

.sort-toggle svg {
    width: 12px;
    height: 8px;
}

/* Sort Dropdown */
.shop-sort {
    position: relative;
    padding: 10px !important;
    border-left: 1px solid #e0e0e0;
}

.shop-sort select,
.woocommerce-ordering select {
    background: transparent;
    border: none;
    padding: 0 20px 0 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    color: #333;
    background-image: url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 8 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L4 4L7 1' stroke='%23333' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
    min-width: auto;
}

.shop-sort select:hover,
.woocommerce-ordering select:hover {
    opacity: 0.7;
}

.shop-sort select:focus,
.woocommerce-ordering select:focus {
    outline: none;
}

/* Sort Sidebar (Right Side) */
.sort-sidebar {
    position: absolute;
    top: 90px;
    right: 0;
    width: 0;
    min-width: 0;
    background: white;
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    border-right: none;
    z-index: 1000;
}

.sort-sidebar.active {
    width: auto !important;
    min-width: 220px !important;
}

.sort-content {
    width: auto;
    background: white;
    height: auto;
}

.sort-header-new {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #333;
}

.sort-header-new svg {
    width: 14px;
    height: 8px;
}

.sort-options {
    padding: 10px 0;
}

.sort-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sort-item {
    padding: 4px 15px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #5c4033;
    line-height: 1.5;
    margin: 0;
}

.sort-item:hover {
    background: #f9f9f9;
    color: #000;
}

.sort-item.active {
    color: #000;
    font-weight: 500;
}

/* Shop Main Content - Flexbox Container */
.shop-main-content {
    display: flex;
    gap: 0;
    align-items: flex-start;
}

/* Filters Sidebar */
.filters-sidebar {
    width: 0;
    min-width: 0;
    background: white;
    transition: all 0.3s ease;
    overflow: hidden;
    border-right: 1px solid #e0e0e0;
    order: 1;
}

.filters-sidebar.active {
    width: 240px;
    min-width: 240px;
}

.filters-content {
    width: 240px;
    background: white;
    height: auto;
}

.filters-sidebar.active .filters-content {
    transform: translateX(0);
}

/* Filters Header */
.filters-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: white;
}

.filters-close {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 0;
    color: #333;
}

.filters-close:hover {
    opacity: 0.7;
}

.filters-close svg {
    width: 16px;
    height: 16px;
}

/* Filters Widgets */
.filters-widgets {
    padding: 20px;
}

.filter-widget {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.filter-widget:last-child {
    border-bottom: none;
}

.filter-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 15px;
    color: #333;
}

/* Filter List */
.filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.filter-list li {
    margin-bottom: 12px;
}

.filter-list label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: color 0.2s ease;
}

.filter-list label:hover {
    color: #333;
}

.filter-list input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: #333;
}

/* Price Filter */
.price-filter {
    padding-top: 10px;
}

.price-slider {
    height: 4px;
    background: #e5e5e5;
    border-radius: 2px;
    margin-bottom: 20px;
    position: relative;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-input-group {
    display: flex;
    align-items: center;
    border: 1px solid #e5e5e5;
    padding: 8px 12px;
    border-radius: 4px;
    flex: 1;
}

.price-input-group span {
    font-size: 14px;
    color: #999;
    margin-right: 5px;
}

.price-input-group input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
    color: #333;
}

/* Products Grid */
.products-grid-container {
    margin-top: 0;
    padding: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    flex: 1;
    width: 100%;
    order: 2;
}

.products {
    display: grid;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 5px !important;
    list-style: none;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
}

ul.products {
    gap: 5px !important;
    padding: 0 !important;
}

.woocommerce ul.products {
    gap: 5px !important;
    padding: 0 !important;
}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    padding: 0 !important;
    margin: 0 !important;
}

/* Product Item */
.product {
    position: relative;
    text-align: left;
}

.product-image {
    position: relative;
    overflow: hidden;
    background: #f9f9f9;
    aspect-ratio: 2/3;
    margin-bottom: 15px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product:hover .product-image img {
    transform: scale(1.05);
}

/* Product Info */
.product-title,
.woocommerce-loop-product__title {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.product-title a,
.woocommerce-loop-product__title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-title a:hover,
.woocommerce-loop-product__title a:hover {
    color: #666;
}

.price {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

/* Sold Out Badge */
.sold-out-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    z-index: 2;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .products {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 5px !important;
    }
}

@media (max-width: 768px) {
    .products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 5px !important;
    }
    
    .product-card-image {
        height: 320px;
        aspect-ratio: auto;
    }

    .product-image-link,
    .product-main-image,
    .product-hover-image {
        height: 100%;
        width: 100%;
        object-fit: cover;
    }
    
    .filters-content {
        width: 320px;
    }
    
    .shop-toolbar {
        gap: 15px;
        align-items: stretch;
        display: flex;
    }
    
    .shop-toolbar .filters-toggle,
    .shop-toolbar .sort-toggle,
    .shop-toolbar .shop-sort select {
        flex: 1;
        min-width: 0;
        width: auto;
    }
}

@media (max-width: 480px) {
    .products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 5px !important;
    }
    
    .filters-content {
        width: 320px;
    }

    .shop-toolbar {
        display: flex;
        gap: 8px;
        align-items: stretch;
    }

    .shop-toolbar .filters-toggle,
    .shop-toolbar .sort-toggle,
    .shop-toolbar .shop-sort select {
        flex: 1;
        min-width: 0;
        width: auto;
        padding: 12px;
        justify-content: center;
    }
}

/* Pagination */
.woocommerce-pagination {
    margin-top: 60px;
    text-align: center;
}

.woocommerce-pagination ul {
    display: inline-flex;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce-pagination li {
    display: inline-block;
}

.woocommerce-pagination a,
.woocommerce-pagination span {
    display: block;
    padding: 10px 15px;
    border: 1px solid #e5e5e5;
    color: #666;
    text-decoration: none;
    transition: all 0.2s ease;
}

.woocommerce-pagination a:hover,
.woocommerce-pagination .current {
    background: #333;
    color: white;
    border-color: #333;
}

/* ==========================================================================
   Product Card Styles
   ========================================================================== */

/* Product Card Container */
.product-card {
    position: relative;
    list-style: none;
    padding: 0 !important;
    margin: 0 !important;
}

.product-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
    margin: 0;
}

/* Product Image Container */
.product-card-image {
    position: relative;
    overflow: hidden;
    background: #000;
    aspect-ratio: 2/3;
    margin-bottom: 0;
    border-radius: 0;
}

.product-image-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

/* Product Images */
.product-main-image,
.product-hover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.5s ease;
}

/* Hover Image Effect */
.product-hover-image {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.product-card:hover .product-hover-image {
    opacity: 1;
}

/* Image Overlay - Shows product name and stock status on hover */
.product-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.product-card:hover .product-image-overlay {
    opacity: 1;
}

.product-overlay-title {
    font-size: 14px;
    font-weight: 400;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.product-overlay-price {
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    margin-bottom: 5px;
}

.product-overlay-price span {
    color: #fff;
}

.product-overlay-price del {
    color: rgba(255, 255, 255, 0.6);
    margin-right: 8px;
}

.product-overlay-price ins {
    text-decoration: none;
    color: #fff;
}

.product-overlay-stock {
    font-size: 12px;
    font-weight: 300;
    color: #fff;
    text-transform: capitalize;
}

/* Remove all badges, buttons, and product content - image only */
.product-badges,
.quick-view-btn,
.wishlist-btn,
.product-card-content,
.product-category,
.product-title,
.product-price,
.product-rating,
.product-swatches,
.product-actions {
    display: none;
}

/* Product Badges */
.product-badges {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
}

.badge-sale {
    background: #ff4444;
    color: white;
}

.badge-sold-out {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border: 1px solid #ddd;
}

.badge-new {
    background: #4CAF50;
    color: white;
}

.badge-featured {
    background: #FFB74D;
    color: white;
}

/* Quick View Button */
.quick-view-btn {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: white;
    border: none;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.quick-view-btn svg {
    width: 16px;
    height: 16px;
}

.product-card:hover .quick-view-btn {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.quick-view-btn:hover {
    background: #333;
    color: white;
}

/* Wishlist Button */
.wishlist-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 4;
}

.product-card:hover .wishlist-btn {
    opacity: 1;
}

.wishlist-btn:hover {
    background: white;
    transform: scale(1.1);
}

.wishlist-btn:hover svg path {
    fill: #ff4444;
    stroke: #ff4444;
}

.wishlist-btn.active svg path {
    fill: #ff4444;
    stroke: #ff4444;
}

/* Product Content */
.product-card-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 4px;
}

/* Product Category */
.product-category {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #999;
}

.product-category a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-category a:hover {
    color: #666;
}

/* Product Title */
.product-title {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1.4;
    margin: 0;
    color: #333;
}

.product-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-title a:hover {
    color: #666;
}

/* Product Price */
.product-price {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-top: 4px;
}

.product-price .price {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Regular and Sale Price */
.product-price del {
    color: #999;
    font-weight: 400;
    font-size: 14px;
}

.product-price ins {
    text-decoration: none;
    color: #ff4444;
}

/* Product Rating */
.product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.star-rating {
    position: relative;
    font-size: 14px;
    line-height: 1;
    width: 70px;
    height: 14px;
    overflow: hidden;
}

.star-rating::before {
    content: "★★★★★";
    color: #ddd;
    letter-spacing: 2px;
}

.star-rating span {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    white-space: nowrap;
}

.star-rating span::before {
    content: "★★★★★";
    color: #FFB74D;
    letter-spacing: 2px;
}

.rating-count {
    font-size: 12px;
    color: #999;
}

/* Color Swatches */
.product-swatches {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-swatch:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 2px #333;
}

.color-count {
    font-size: 11px;
    color: #999;
    margin-left: 4px;
}

/* Product Actions */
.product-actions {
    margin-top: 12px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateY(0);
}

/* Buttons */
.add-to-cart-btn,
.select-options-btn,
.out-of-stock-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: #333;
    color: white;
    border: none;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.add-to-cart-btn:hover,
.select-options-btn:hover {
    background: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.add-to-cart-btn svg {
    width: 16px;
    height: 16px;
}

.out-of-stock-btn {
    background: #e5e5e5;
    color: #999;
    cursor: not-allowed;
}

.out-of-stock-btn:hover {
    background: #e5e5e5;
    transform: none;
    box-shadow: none;
}

/* Loading State */
.add-to-cart-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.add-to-cart-btn.loading::after {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Added to Cart State */
.add-to-cart-btn.added span::after {
    content: " ✓";
    margin-left: 4px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .products {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 5px !important;
    }
    
    .product-title {
        font-size: 13px;
    }
    
    .product-price {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 5px !important;
    }
    
    .product-card-image {
        height: 320px;
        aspect-ratio: auto;
    }

    .product-image-link,
    .product-main-image,
    .product-hover-image {
        height: 100%;
        width: 100%;
        object-fit: cover;
    }
    
    .filters-content {
        width: 100%;
    }
    
    .shop-toolbar {
        gap: 0px;
        align-items: stretch;
        display: flex;
    }
    
    .shop-toolbar .filters-toggle,
    .shop-toolbar .sort-toggle,
    .shop-toolbar .shop-sort select {
        flex: 1;
        min-width: 0;
        width: auto;
        padding: 14px;
        justify-content: center;
    }

    /* Mobile: make overlay always visible and disable hover image (no hover on touch devices) */
    .product-image-overlay {
        opacity: 1 !important;
        transition: none !important;
        padding-bottom: 5px;
    }

    .product-hover-image {
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* Ensure hover styles do not override on touch devices */
    .product-card:hover .product-hover-image {
        opacity: 0 !important;
    }
    .product-card:hover .product-image-overlay {
        opacity: 1 !important;
    }
}

@media (max-width: 480px) {
    .products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 5px !important;
    }
    
    .filters-content {
        width: 100%;
    }
}

/* Accessibility */
.product-card:focus-within {
    outline: 2px solid #4A90E2;
    outline-offset: 4px;
}

button:focus,
a:focus {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .quick-view-btn,
    .wishlist-btn,
    .product-actions {
        display: none;
    }
}
