/* WooCommerce Styles for MakhiMarket Theme */

/* Shop/Archive Page Styles */
.woocommerce .shop-container {
    background: linear-gradient(167deg, #00BCD4 0%, #2a5298 100%);
    padding: 30px;
    color: white;
    position: relative;
    overflow: hidden;
}

.woocommerce .shop-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="80" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="40" cy="60" r="1" fill="rgba(255,255,255,0.08)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

/* Enhanced Header Section */
.woocommerce .shop-header-section {
    margin-bottom: 40px;
    position: relative;
    z-index: 2;
}

.woocommerce .header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.woocommerce .header-text {
    flex: 1;
    max-width: 60%;
}

.woocommerce .category-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    line-height: 1.2;
}

.woocommerce .category-description {
    font-size: 1.2rem;
    margin-bottom: 25px;
    opacity: 0.9;
    line-height: 1.6;
}

.woocommerce .header-stats {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.woocommerce .stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 16px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.woocommerce .stat-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.woocommerce .stat-item i {
    font-size: 1.1rem;
    color: #FFD700;
}

.woocommerce .stat-item span {
    font-weight: 600;
    font-size: 0.95rem;
}

.woocommerce .header-image {
    flex: 0 0 300px;
    height: 250px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.woocommerce .breadcrumb-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 30px;
}

.woocommerce .shop-content {
    display: flex;
    gap: 30px;
}

.woocommerce .shop-sidebar {
    flex: 0 0 280px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    height: fit-content;
    color: #333;
}

.woocommerce .shop-main {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    color: #333;
}

.woocommerce .filter-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

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

.woocommerce .filter-section h5 {
    color: #1e3c72;
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.woocommerce .trust-badges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.woocommerce .trust-badge {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.woocommerce .trust-badge:hover {
    transform: translateY(-2px);
}

.woocommerce .trust-badge i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #4CAF50;
}

.woocommerce .trust-badge h6 {
    margin-bottom: 5px;
    font-weight: 600;
}

.woocommerce .trust-badge p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.woocommerce .shop-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.woocommerce .view-toggle {
    display: flex;
    gap: 5px;
}

.woocommerce .view-toggle .btn {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    background: white;
    color: #6c757d;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.woocommerce .view-toggle .btn.active,
.woocommerce .view-toggle .btn:hover {
    background: #1e3c72;
    color: white;
    border-color: #1e3c72;
}

.woocommerce .products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

/* WooCommerce product loop - force 4 column grid */
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 25px !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.woocommerce ul.products li.product {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
}

.woocommerce .products-list .product-card {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.woocommerce .products-list .product-image {
    flex: 0 0 150px;
}

.woocommerce .products-list .product-info {
    flex: 1;
}

/* Enhanced Category Header Section */
.woocommerce .category-header-section {
    background: linear-gradient(167deg, #00BCD4 0%, #2a5298 100%);
    border-radius: 5px;
    padding: 40px 0;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.woocommerce .category-header-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
    opacity: 0.3;
}

.woocommerce .category-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    position: relative;
    z-index: 2;
    margin: 40px 10px 0px;
}

.woocommerce .category-header-text {
    flex: 1;
}

.category-header-text > p {
    color: #ffffff;
    opacity: 0.9;
}

.woocommerce .category-main-title {
    font-size: 2.8rem;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
    line-height: 1.2;
}

.woocommerce .category-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0;
    font-weight: 300;
    line-height: 1.4;
}

.woocommerce .category-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: flex-end;
}

.woocommerce .results-count {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 15px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 500;
    font-size: 0.95rem;
}

.woocommerce .results-count > p{
    margin: 0;
}

.woocommerce .sort-dropdown {
    position: relative;
}

.woocommerce .sort-dropdown select {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 12px 40px 12px 16px;
    color: white;
    font-weight: 500;
    font-size: 0.95rem;
    appearance: none;
    cursor: pointer;
    min-width: 200px;
    transition: all 0.3s ease;
}

.woocommerce .sort-dropdown select:hover {
    background: rgba(255, 255, 255, 0.25);
}

.woocommerce .sort-dropdown select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.woocommerce .sort-dropdown::after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    pointer-events: none;
}

.woocommerce .sort-dropdown select option {
    background: #1e3c72;
    color: white;
    padding: 10px;
}

/* Add to Cart Button Enhancements */
.woocommerce .ajax_add_to_cart {
    transition: all 0.3s ease;
    position: relative;
}

.woocommerce .ajax_add_to_cart.loading {
    opacity: 0.7;
    cursor: wait;
}

.woocommerce .ajax_add_to_cart.added {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
}

.woocommerce .ajax_add_to_cart:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Keep original product card styling - only modify grid layout */

/* Sidebar Filters */
.woocommerce .filter-section .form-check {
    margin-bottom: 8px;
}

.woocommerce .filter-section .form-check-input:checked {
    background-color: #1e3c72;
    border-color: #1e3c72;
}

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

.woocommerce .price-range input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
}

.woocommerce .clear-filters {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
}

.woocommerce .clear-filters:hover {
    background: #c82333;
}

/* Compare functionality */
.compare-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.compare-panel.show {
    transform: translateY(0);
    opacity: 1;
}

.compare-panel .compare-count {
    font-weight: 600;
    color: #1e3c72;
}

.compare-panel .btn-compare-view {
    background: #1e3c72;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    margin-left: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .woocommerce .shop-content {
        flex-direction: column;
    }

    .woocommerce .shop-sidebar {
        flex: none;
    }

    .woocommerce .products-grid,
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
    }

    .woocommerce .shop-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .woocommerce .trust-badges {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Category Header responsive */
    .woocommerce .category-header-content {
        flex-direction: column;
        text-align: center;
        gap: 0px;
        margin: 0px 10px 0px;
    }

    .woocommerce .category-main-title {
        font-size: 2.2rem;
    }

    .woocommerce .category-subtitle {
        font-size: 1.1rem;
    }

    .woocommerce .category-controls {
        align-items: center;
        gap: 12px;
    }

    .woocommerce .sort-dropdown select {
        min-width: 180px;
        padding: 10px 35px 10px 14px;
        font-size: 0.9rem;
    }

    .woocommerce .results-count {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    /* Header responsive */
    .woocommerce .header-content {
        flex-direction: column;
        text-align: center;
        display: flex;
        align-items: start;
        /* justify-content: space-between; */
        gap: 5px;
    }

    .woocommerce .header-text {
        max-width: 100%;
    }

    .woocommerce .category-title {
        font-size: 2.2rem;
    }

    .woocommerce .header-stats {
        justify-content: center;
        gap: 15px;
    }

    .woocommerce .stat-item {
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .woocommerce .header-image {
        flex: 0 0 200px;
        height: 180px;
    }

    .woocommerce .floating-icon {
        width: 50px;
        height: 50px;
    }

    .woocommerce .floating-icon i {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .woocommerce .shop-container {
        padding: 20px;
    }

    .woocommerce .shop-sidebar,
    .woocommerce .shop-main {
        padding: 15px;
    }

    .woocommerce .category-title {
        font-size: 1.8rem;
    }

    .woocommerce .category-main-title {
        font-size: 1.8rem;
    }

    .woocommerce .category-subtitle {
        font-size: 1rem;
    }

    .woocommerce .category-controls {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .woocommerce .sort-dropdown select {
        min-width: 100%;
        padding: 10px 35px 10px 14px;
        font-size: 0.9rem;
    }

    .woocommerce .header-stats {
        flex-direction: column;
        gap: 10px;
    }

    .woocommerce .trust-badges {
        grid-template-columns: 1fr;
    }
}

/* Enhanced Product Card Styles */

/* Product Actions Layout */
.product-card .product-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.product-card .cart-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-card .action-icons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Enhanced Add to Cart Button States */
.product-card .btn-add-cart {
    padding: 12px 20px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #007cba 0%, #0093d3 100%);
    color: white;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    width: -webkit-fill-available;
}

.product-card .btn-add-cart:hover {
    background: linear-gradient(135deg, #005a87 0%, #0074a3 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.product-card .btn-add-cart:active {
    transform: translateY(0);
}

/* Loading State */
.product-card .btn-add-cart.loading {
    background: linear-gradient(135deg, #6c757d 0%, #8d9597 100%);
    cursor: wait;
    opacity: 0.8;
}

.product-card .btn-add-cart.loading:hover {
    background: linear-gradient(135deg, #6c757d 0%, #8d9597 100%);
    transform: none;
    box-shadow: none;
}

/* Added State */
.product-card .btn-add-cart.added {
    background: linear-gradient(135deg, #28a745 0%, #34ce57 100%);
    color: white;
}

.product-card .btn-add-cart.added:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #28a745 100%);
}

/* View Cart Button */
.product-card .view-cart-btn {
    background: linear-gradient(135deg, #fd7e14 0%, #ff8c42 100%);
    color: white;
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 6px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: 500;
    width: 100%;
    margin-top: 8px;
    box-shadow: 0 2px 8px rgba(253, 126, 20, 0.2);
}

.product-card .view-cart-btn:hover {
    background: linear-gradient(135deg, #e66100 0%, #fd7e14 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(253, 126, 20, 0.3);
    text-decoration: none;
}

.product-card .view-cart-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(253, 126, 20, 0.2);
}

/* Disabled State */
.product-card .btn-add-cart:disabled {
    background: linear-gradient(135deg, #6c757d 0%, #8d9597 100%);
    cursor: not-allowed;
    opacity: 0.6;
}

.product-card .btn-add-cart:disabled:hover {
    background: linear-gradient(135deg, #6c757d 0%, #8d9597 100%);
    transform: none;
    box-shadow: none;
}

/* Custom Notifications */
.custom-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 1055;
    min-width: 300px;
    max-width: 400px;
    padding: 16px 20px;
    border-radius: 10px;
    border: none;
    font-weight: 500;
    font-size: 0.95rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.4s ease-out;
    backdrop-filter: blur(10px);
}

.custom-notification.alert-success {
    background: linear-gradient(135deg, rgba(212, 237, 218, 0.95) 0%, rgba(195, 230, 203, 0.95) 100%);
    color: #155724;
    border-left: 4px solid #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.custom-notification.alert-danger {
    background: linear-gradient(135deg, rgba(248, 215, 218, 0.95) 0%, rgba(245, 198, 203, 0.95) 100%);
    color: #721c24;
    border-left: 4px solid #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.custom-notification .btn-close {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2rem;
    opacity: 0.7;
    cursor: pointer;
}

.custom-notification .btn-close:hover {
    opacity: 1;
}

/* Notification Animation */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.custom-notification.fade-out {
    animation: slideOutRight 0.3s ease-in forwards;
}

/* Spinner Animation */
.fa-spinner.fa-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsiveness for Enhanced Elements */
@media (max-width: 768px) {
    .product-card .btn-add-cart {
        padding: 10px 0px;
        font-size: 12px;
        min-height: 20px;
    }
    .product-rating{
        gap: 1px;
        margin-bottom: 2px;
    }

    .product-card .view-cart-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .custom-notification {
        margin: 15px 0;
        padding: 12px 16px;
        font-size: 0.9rem;
    }

        .breadcrumb {
        padding: 15px 20px;
        border-radius: 8px;
        margin: 0 auto;
        width: 100%;
    }
}