/**
 * Product Archive Styles
 * Modern shop page styling based on Hisense design
 */

/* Product Grid Layout */
.mesco-products-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 27px 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.hisense-product-item {
    list-style: none;
    margin: 0;
    padding: 0;
}

.product-badges {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
    display: flex;
    gap: 10px;
}

/* No Image Styles */
.product-image.no-image {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image.no-image img.placeholder-image {
    width: 80%;
    height: 80%;
    object-fit: contain;
    opacity: 0.7;
}

.no-image-overlay {
    display: none;
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* Quick Look Overlay */
.quick-look-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}


.product-title {
    font-size: 16px;
    line-height: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.product-title a {
    color: #091016;
    text-transform: capitalize;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.variable-attributes {
    margin-top: 12px;
    margin-bottom: 15px;
}

.attributes-list {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #007cba;
    font-size: 13px;
}

.attribute-item {
    margin-bottom: 6px;
    line-height: 1.4;
}

.attribute-item:last-child {
    margin-bottom: 0;
}

.attribute-label {
    font-weight: 600;
    color: #495057;
}

.attribute-options {
    color: #6c757d;
}

.more-options {
    color: #007cba;
    font-weight: 500;
    font-style: italic;
}

.variable-indicator {
    background: #e3f2fd;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #1976d2;
    text-align: center;
}

.variable-indicator span {
    font-size: 13px;
    color: #1976d2;
    font-weight: 500;
}

.compare-text {
    font-weight: 500;
}

.quick-look-btn,
.compare-btn,
.details-btn,
.buy-now-btn {
    padding: 14px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.quick-look-btn {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.compare-btn {
    background: transparent;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.compare-btn:hover,
.compare-btn.active {
    background: #00d4aa;
    color: #fff;
    border-color: #00d4aa;
}

.details-btn {
    background: #6c757d;
    color: #fff;
}

.details-btn:hover {
    color: #ffffff;
    background: #36A8A5;
}

.buy-now-btn {
    width: 100%;
    background: #f2f7fb;
    color: #091016;
}

.buy-now-btn:hover {
    background: rgba(0, 101, 179, 0.1);
    color: #3384C2;
}

.buy-now-btn.variable {
    background: #3742fa;
}

.buy-now-btn.variable:hover {
    background: #36A8A5;
}

.compare-icon::before {
    content: "⚖";
}

.hisense-quick-view-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    display: none !important;
    background: rgba(0, 0, 0, 0.85) !important;
    backdrop-filter: blur(8px) !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

.hisense-quick-view-modal.show {
    display: flex !important;
}

body.modal-open {
    overflow: hidden !important;
    height: 100vh !important;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1;
}

.modal-content {
    position: relative !important;
    background: #fff !important;
    border-radius: 16px !important;
    max-width: 1000px !important;
    width: 95% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    z-index: 1000000 !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4) !important;
    animation: modalSlideIn 0.4s ease-out !important;
    margin: auto !important;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

body.modal-open {
    overflow: hidden;
    padding-right: 15px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    z-index: 10;
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

.product-details h2 {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #2c3e50;
}

.product-details .product-price {
    font-size: 28px;
    margin-bottom: 20px;
}

.product-specifications,
.product-highlights {
    margin: 20px 0;
}

.product-specifications h4,
.product-highlights h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #2c3e50;
}

.product-specifications ul,
.product-highlights ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.product-specifications li,
.product-highlights li {
    padding: 5px 0;
    border-bottom: 1px solid #f1f2f6;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}


.hisense-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: #fff;
    font-weight: 600;
    z-index: 10000;
    display: none;
    min-width: 300px;
}

.hisense-notification.success {
    background: #00d4aa;
}

.hisense-notification.error {
    background: #ff4757;
}

.notification-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    float: right;
    margin-left: 10px;
}

.quick-look-loader {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.7) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 999998 !important;
    backdrop-filter: blur(3px) !important;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #00d4aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-text {
    color: white;
    font-size: 16px;
    font-weight: 500;
    margin-top: 20px;
    text-align: center;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.hisense-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 999999;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hisense-notification.success {
    background: #28a745;
}

.hisense-notification.error {
    background: #dc3545;
}

.hisense-notification.info {
    background: #17a2b8;
}

.add-to-cart-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
}

.add-to-cart-popup .popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.add-to-cart-popup .popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.add-to-cart-popup .popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    z-index: 10;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.add-to-cart-popup .popup-close:hover {
    background: #f5f5f5;
    color: #333;
}

.add-to-cart-popup .popup-header {
    text-align: center;
    padding: 30px 20px 20px;
    background: linear-gradient(135deg, #00d4aa, #007cba);
    color: white;
}

.add-to-cart-popup .success-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: bold;
    margin: 0 auto 15px;
}

.add-to-cart-popup .popup-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.add-to-cart-popup .popup-body {
    padding: 30px;
}

.add-to-cart-popup .product-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.add-to-cart-popup .popup-product-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.add-to-cart-popup .product-details h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.add-to-cart-popup .product-details p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.add-to-cart-popup .popup-actions {
    display: flex;
    gap: 15px;
    padding: 0 30px 30px;
}

.add-to-cart-popup .continue-shopping,
.add-to-cart-popup .view-cart {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-to-cart-popup .continue-shopping {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #e9ecef;
}

.add-to-cart-popup .continue-shopping:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.add-to-cart-popup .view-cart {
    background: #007cba;
    color: white;
}

.add-to-cart-popup .view-cart:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

.woocommerce-before-shop-loop {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

.woocommerce-result-count {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.woocommerce-ordering {
    margin-bottom: 30px;
}

.woocommerce-MyAccount-content .hisense-product-card .product-price i {
    font-size: 18px;
    position: relative;
    bottom: 1px;
}


@media (max-width: 1450px) {
    .mesco-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .product-title {
        font-size: 16px;
    }

    .hisense-product-card .product-price img {
        width: 15px
    }

}

@media (max-width: 1300px) {
    .mesco-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    }
}

@media (max-width: 860px) {
    .mesco-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(229px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .woocommerce-before-shop-loop {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .woocommerce-result-count {
        text-align: center;
    }

    .woocommerce-ordering {
        text-align: center;
    }

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

    .shop-controls-left,
    .shop-controls-right {
        justify-content: center;
        flex-wrap: wrap;
    }

    .hisense-ordering-wrapper {
        justify-content: center;
    }

    .select-wrapper {
        min-width: 100%;
    }



    .modal-body {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }

    .product-actions {
        flex-direction: column;
    }

    .modal-actions {
        flex-direction: column;
    }

    .hisense-notification {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

@media (max-width: 767px) {
    .woocommerce-result-count {
        display: none;
    }

    .mesco-products-grid {
        gap: 20px;
    }

    .woocommerce-ordering {
        margin-bottom: 20px;
    }





     .mesco-products-grid {
        grid-template-columns: unset;
        gap: 10px; 
         display: flex;
        flex-wrap: wrap;
    }

    .hisense-product-item{     width: 48%;}
    .product-title a {
        font-size: 12px;
        line-height: 15px;
    }
    .product-price {
        font-size: 13px;
    }
    .product-price i {
    font-size: 11px;
}
}

@media (max-width: 480px) {
    .add-to-cart-popup .popup-content {
        width: 95%;
        margin: 20px;
    }

    .add-to-cart-popup .popup-header {
        padding: 20px 15px 15px;
    }

    .add-to-cart-popup .success-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .add-to-cart-popup .popup-header h3 {
        font-size: 20px;
    }

    .add-to-cart-popup .popup-body {
        padding: 20px;
    }

    .add-to-cart-popup .product-info {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .add-to-cart-popup .popup-product-image {
        width: 60px;
        height: 60px;
    }

    .add-to-cart-popup .popup-actions {
        flex-direction: column;
        padding: 0 20px 20px;
    }
}