/**
 * WooCommerce Shop Styles - Methaq Theme
 * Fixed RTL Arabic Design
 */

/* ======================================
   RESET WOOCOMMERCE DEFAULTS
   ====================================== */
.woocommerce .products,
.woocommerce-page .products,
.woocommerce ul.products,
.woocommerce-page ul.products {
    margin: 0 !important;
    padding: 30px !important;
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 25px !important;
    list-style: none !important;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
    display: none !important;
}

/* ======================================
   PRODUCT CARD
   ====================================== */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    border: 1px solid rgba(36, 87, 155, 0.1) !important;
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 15px 40px rgba(36, 87, 155, 0.18) !important;
}

/* ======================================
   PRODUCT IMAGE
   ====================================== */
.woocommerce ul.products li.product a img,
.woocommerce ul.products li.product img.attachment-woocommerce_thumbnail {
    width: 100% !important;
    height: 200px !important;
    object-fit: contain !important;
    padding: 20px !important;
    background: linear-gradient(180deg, #f8fafc, #fff) !important;
    margin: 0 !important;
    border-bottom: 1px solid #eee !important;
}

/* Placeholder image fix */
.woocommerce ul.products li.product .woocommerce-placeholder {
    width: 100% !important;
    height: 200px !important;
    object-fit: contain !important;
    padding: 40px !important;
    background: #f8fafc !important;
}

/* ======================================
   PRODUCT TITLE
   ====================================== */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h2 {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #1a365d !important;
    padding: 15px !important;
    margin: 0 !important;
    text-align: center !important;
    line-height: 1.5 !important;
    min-height: 70px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #fff !important;
}

/* ======================================
   PRODUCT PRICE
   ====================================== */
.woocommerce ul.products li.product .price {
    display: block !important;
    text-align: center !important;
    padding: 10px 15px !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #24579b !important;
    background: linear-gradient(180deg, transparent, rgba(36, 87, 155, 0.05)) !important;
}

.woocommerce ul.products li.product .price del {
    color: #999 !important;
    font-size: 14px !important;
}

.woocommerce ul.products li.product .price ins {
    text-decoration: none !important;
}

/* ======================================
   ADD TO CART BUTTON
   ====================================== */
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .add_to_cart_button {
    display: block !important;
    width: calc(100% - 30px) !important;
    margin: 0 15px 15px !important;
    padding: 12px 20px !important;
    background: linear-gradient(135deg, #24579b, #1a365d) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
}

.woocommerce ul.products li.product .button:hover {
    background: linear-gradient(135deg, #1a365d, #0f172a) !important;
    transform: translateY(-2px) !important;
}

/* View Cart Link */
.woocommerce ul.products li.product .added_to_cart {
    display: block !important;
    text-align: center !important;
    padding: 8px !important;
    color: #25D366 !important;
    font-weight: 600 !important;
    font-size: 13px !important;
}

/* ======================================
   SHOP PAGE HEADER
   ====================================== */
.woocommerce-products-header {
    text-align: center !important;
    padding: 40px 20px !important;
    background: linear-gradient(135deg, #f8fafc, #e6efff) !important;
    margin-bottom: 20px !important;
}

.woocommerce-products-header__title {
    font-size: 32px !important;
    color: #1a365d !important;
    margin: 0 0 10px !important;
}

/* Result Count & Ordering */
.woocommerce-result-count {
    float: right !important;
    margin: 0 0 20px !important;
    padding: 10px 15px !important;
    background: #f8fafc !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    color: #64748b !important;
}

.woocommerce-ordering {
    float: left !important;
    margin: 0 0 20px !important;
}

.woocommerce-ordering select {
    padding: 10px 15px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    background: #fff !important;
}

/* ======================================
   PAGINATION
   ====================================== */
.woocommerce nav.woocommerce-pagination {
    text-align: center !important;
    margin: 40px 0 !important;
}

.woocommerce nav.woocommerce-pagination ul {
    display: inline-flex !important;
    gap: 8px !important;
    border: none !important;
}

.woocommerce nav.woocommerce-pagination ul li {
    border: none !important;
}

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
    padding: 12px 18px !important;
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    color: #1a365d !important;
    font-weight: 600 !important;
    transition: all 0.2s !important;
}

.woocommerce nav.woocommerce-pagination ul li a:hover {
    background: #24579b !important;
    color: #fff !important;
    border-color: #24579b !important;
}

.woocommerce nav.woocommerce-pagination ul li span.current {
    background: linear-gradient(135deg, #24579b, #1a365d) !important;
    color: #fff !important;
    border-color: #24579b !important;
}

/* ======================================
   RESPONSIVE DESIGN
   ====================================== */
@media (max-width: 1200px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 900px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
        padding: 20px !important;
    }
}

@media (max-width: 600px) {
    .woocommerce ul.products {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    .woocommerce ul.products li.product img {
        height: 180px !important;
    }
}

/* ======================================
   QUICK VIEW MODAL (Keep existing)
   ====================================== */
.msps-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(6, 20, 47, 0.85);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.msps-modal-overlay.active {
    display: flex;
}

.msps-modal {
    background: #fff;
    border-radius: 20px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.msps-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(180deg, #f8fafc, #fff);
}

.msps-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1a365d;
}

.msps-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.msps-modal-close:hover {
    background: #e74c3c;
    color: #fff;
}

.msps-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 25px;
    max-height: 70vh;
    overflow-y: auto;
}

.msps-modal-image {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.msps-modal-image img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.msps-modal-details h4 {
    margin: 0 0 10px;
    color: #1a365d;
    font-size: 16px;
}

.msps-modal-price {
    font-size: 24px;
    font-weight: 800;
    color: #24579b;
    margin-bottom: 15px;
}

.msps-modal-description {
    color: #64748b;
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.msps-variation-options {
    margin-bottom: 20px;
}

.msps-variation-options label {
    display: block;
    font-weight: 600;
    color: #1a365d;
    margin-bottom: 10px;
}

.msps-variation-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.msps-variation-btn {
    padding: 10px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #1a365d;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.msps-variation-btn:hover {
    border-color: #24579b;
    background: rgba(36, 87, 155, 0.05);
}

.msps-variation-btn.active {
    background: linear-gradient(135deg, #24579b, #1a365d);
    color: #fff;
    border-color: #24579b;
}

.msps-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.msps-add-to-cart {
    flex: 1;
    padding: 14px 24px;
    background: linear-gradient(135deg, #24579b, #1a365d);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.msps-add-to-cart:hover {
    background: linear-gradient(135deg, #1a365d, #0f172a);
    transform: translateY(-2px);
}

.msps-whatsapp-btn {
    padding: 14px 20px;
    background: #25D366;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.msps-whatsapp-btn:hover {
    background: #128C7E;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .msps-modal-body {
        grid-template-columns: 1fr;
    }
}

/* ======================================
   SUCCESS MESSAGE POPUP
   ====================================== */
.msps-success-message {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.msps-success-icon {
    font-size: 48px;
    margin-bottom: 10px;
    animation: bounce 0.5s ease;
}

@keyframes bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.msps-success-text {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
}

.msps-view-cart-link {
    display: inline-block;
    padding: 10px 25px;
    background: rgba(255, 255, 255, 0.25);
    color: #fff !important;
    border-radius: 8px;
    font-weight: 700;
    transition: all 0.3s;
    text-decoration: none !important;
}

.msps-view-cart-link:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* ======================================
   NEW SUCCESS BOX WITH ACTIONS
   ====================================== */
.msps-success-box {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.msps-success-box .msps-success-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.msps-success-box .msps-success-text {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 20px;
}

.msps-success-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.msps-btn-continue,
.msps-btn-cart {
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none !important;
    transition: all 0.3s;
}

.msps-btn-continue {
    background: rgba(255, 255, 255, 0.2);
    color: #fff !important;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.msps-btn-continue:hover {
    background: rgba(255, 255, 255, 0.3);
}

.msps-btn-cart {
    background: #fff;
    color: #128C7E !important;
}

.msps-btn-cart:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

/* ======================================
   QUANTITY CONTROLS
   ====================================== */
.msps-quantity-wrapper {
    margin: 20px 0;
}

.msps-quantity-wrapper label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    color: #1a365d;
}

.msps-quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.msps-qty-btn {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(36, 87, 155, 0.2);
    border-radius: 10px;
    background: #fff;
    color: #1a365d;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.msps-qty-btn:hover {
    background: #24579b;
    color: #fff;
    border-color: #24579b;
}

#msps-quantity {
    width: 60px;
    height: 40px;
    text-align: center;
    border: 2px solid rgba(36, 87, 155, 0.2);
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    color: #1a365d;
}

/* ======================================
   LOADING SPINNER
   ====================================== */
.msps-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ======================================
   VARIATION BUTTONS IMPROVEMENT
   ====================================== */
.msps-variation-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.msps-variation-btn {
    padding: 12px 20px;
    border: 2px solid rgba(36, 87, 155, 0.2);
    border-radius: 10px;
    background: #fff;
    color: #1a365d;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 60px;
}

.msps-variation-btn:hover {
    border-color: #24579b;
    background: rgba(36, 87, 155, 0.05);
}

.msps-variation-btn.active {
    background: linear-gradient(135deg, #24579b, #1a365d);
    color: #fff;
    border-color: #24579b;
}

/* ======================================
   SHOP SEARCH BAR
   ====================================== */
.methaq-shop-search {
    max-width: 600px;
    margin: 0 auto 30px;
    padding: 0 20px;
}

.methaq-shop-search form {
    display: flex;
    gap: 10px;
    background: #fff;
    padding: 8px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(36, 87, 155, 0.1);
}

.methaq-shop-search input[type="search"] {
    flex: 1;
    border: none;
    padding: 15px 20px;
    font-size: 16px;
    border-radius: 12px;
    background: #f8fafc;
    color: #1a365d;
    outline: none;
}

.methaq-shop-search input[type="search"]::placeholder {
    color: #94a3b8;
}

.methaq-shop-search input[type="search"]:focus {
    background: #f1f5f9;
}

.methaq-shop-search button {
    padding: 15px 30px;
    background: linear-gradient(135deg, #24579b, #1a365d);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.methaq-shop-search button:hover {
    background: linear-gradient(135deg, #1a365d, #0f172a);
    transform: translateY(-2px);
}

.methaq-shop-search button svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 600px) {
    .methaq-shop-search form {
        flex-direction: column;
    }

    .methaq-shop-search button {
        justify-content: center;
    }
}

/* ======================================
   RELATED PRODUCTS SECTION
   ====================================== */
.related.products {
    margin: 60px 0 40px !important;
    padding: 50px 40px !important;
    background: linear-gradient(180deg, #f1f5f9 0%, #fff 100%) !important;
    border-radius: 24px !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05) !important;
}

.related.products>h2 {
    text-align: center !important;
    font-size: 28px !important;
    font-weight: 800 !important;
    color: #1a365d !important;
    margin-bottom: 40px !important;
    position: relative !important;
    padding-bottom: 18px !important;
}

.related.products>h2::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 100px !important;
    height: 4px !important;
    background: linear-gradient(90deg, #24579b, #25D366) !important;
    border-radius: 2px !important;
}

.related.products ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 25px !important;
    padding: 0 !important;
    margin: 0 !important;
}

.related.products ul.products li.product {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    float: none !important;
    background: #fff !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    border: 1px solid rgba(36, 87, 155, 0.08) !important;
}

.related.products ul.products li.product:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 12px 30px rgba(36, 87, 155, 0.15) !important;
}

.related.products ul.products li.product a img {
    width: 100% !important;
    height: 150px !important;
    object-fit: contain !important;
    padding: 20px !important;
    background: linear-gradient(180deg, #f8fafc, #fff) !important;
    border-bottom: 1px solid #eee !important;
}

.related.products ul.products li.product .woocommerce-loop-product__title,
.related.products ul.products li.product h2 {
    font-size: 14px !important;
    font-weight: 700 !important;
    min-height: 50px !important;
    padding: 15px 15px 10px !important;
    margin: 0 !important;
    line-height: 1.4 !important;
    text-align: center !important;
    color: #1a365d !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.related.products ul.products li.product .price {
    font-size: 18px !important;
    font-weight: 800 !important;
    padding: 10px 15px 15px !important;
    text-align: center !important;
    color: #24579b !important;
    background: transparent !important;
}

.related.products ul.products li.product .button {
    display: block !important;
    padding: 12px 15px !important;
    font-size: 14px !important;
    margin: 0 15px 15px !important;
    width: calc(100% - 30px) !important;
    background: linear-gradient(135deg, #24579b, #1a365d) !important;
    color: #fff !important;
    border-radius: 10px !important;
    text-align: center !important;
    font-weight: 700 !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.related.products ul.products li.product .button:hover {
    background: linear-gradient(135deg, #1a365d, #0f172a) !important;
    transform: translateY(-2px) !important;
}

/* Responsive for Related Products */
@media (max-width: 1200px) {
    .related.products ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 900px) {
    .related.products ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .related.products {
        padding: 30px 20px !important;
    }
}

@media (max-width: 600px) {
    .related.products ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }

    .related.products>h2 {
        font-size: 22px !important;
    }

    .related.products ul.products li.product a img {
        height: 120px !important;
    }
}

/* ======================================
   SINGLE PRODUCT PAGE IMPROVEMENTS
   ====================================== */
.single-product .product .woocommerce-product-gallery {
    background: #f8fafc !important;
    border-radius: 16px !important;
    padding: 20px !important;
}

.single-product .product .summary {
    padding: 20px !important;
}

.single-product .product .summary .price {
    font-size: 28px !important;
    font-weight: 800 !important;
    color: #24579b !important;
    margin: 20px 0 !important;
}

.single-product .product .summary .single_add_to_cart_button {
    background: linear-gradient(135deg, #24579b, #1a365d) !important;
    color: #fff !important;
    border: none !important;
    padding: 15px 40px !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.single-product .product .summary .single_add_to_cart_button:hover {
    background: linear-gradient(135deg, #1a365d, #0f172a) !important;
    transform: translateY(-2px) !important;
}