/* WooCommerce Pro Features (Mini Cart & Quick View) */

/* 1. Slide-out Mini Cart Drawer */
.matcha-mini-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(5px);
}
.matcha-mini-cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.matcha-mini-cart-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 100%;
    max-width: 420px;
    height: 100%;
    background: #fff;
    z-index: 9999;
    box-shadow: -10px 0 40px rgba(0,0,0,0.15);
    transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    display: flex;
    flex-direction: column;
}
.matcha-mini-cart-drawer.active {
    right: 0;
}

.mini-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 30px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}
.mini-cart-header h3 {
    margin: 0;
    font-size: 20px;
    font-family: var(--font-serif, "Playfair Display", serif);
    color: var(--charcoal, #2a2a2a);
    font-weight: 600;
}
.mini-cart-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #888;
    padding: 0;
    transition: color 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mini-cart-close:hover {
    color: #000;
    transform: rotate(90deg);
}

.mini-cart-body {
    padding: 30px;
    flex-grow: 1;
    overflow-y: auto;
}

/* Customizing WooCommerce Default Mini Cart Styles */
.mini-cart-body ul.cart_list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.mini-cart-body ul.cart_list li {
    display: flex !important;
    align-items: center !important;
    padding: 15px 50px 15px 0 !important; /* Add right padding to prevent overlap */
    border-bottom: 1px solid #f0f0f0;
    position: relative !important;
}
.mini-cart-body ul.cart_list li:last-child {
    border-bottom: none;
}
.mini-cart-body ul.cart_list li img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: var(--global-radius, 6px);
    margin-right: 15px !important;
    margin-left: 0 !important;
    float: none !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.woocommerce-mini-cart .cart_list li a.remove,
.mini-cart-body ul.cart_list li .remove {
    position: absolute !important;
    right: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    left: auto !important;
    color: #999 !important;
    font-size: 20px !important;
    text-decoration: none !important;
    font-weight: 400 !important;
    background: #f9f9f9 !important;
    border-radius: 50% !important;
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    transition: all 0.2s ease !important;
}
.woocommerce-mini-cart .cart_list li a.remove:hover,
.mini-cart-body ul.cart_list li .remove:hover {
    background: #e74c3c !important;
    color: #fff !important;
}
.mini-cart-body ul.cart_list li a {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    display: block;
    line-height: 1.4;
    margin-bottom: 5px;
}
.mini-cart-body ul.cart_list li .quantity {
    font-size: 14px;
    color: #666;
}
.mini-cart-body .total {
    border-top: 2px solid #000;
    padding: 20px 0;
    margin-top: 20px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
}
.mini-cart-body .buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}
.mini-cart-body .buttons a {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px;
    border-radius: 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.3s ease;
}
.mini-cart-body .buttons a.wc-forward {
    background: #f0f0f0;
    color: #333;
}
.mini-cart-body .buttons a.wc-forward:hover {
    background: #e0e0e0;
}
.mini-cart-body .buttons a.checkout {
    background: #000;
    color: #fff;
}
.mini-cart-body .buttons a.checkout:hover {
    background: var(--sage, #728c69);
    color: #fff;
}


/* 2. Quick View Modal */
.matcha-quick-view-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}
.matcha-quick-view-overlay.active {
    opacity: 1;
    visibility: visible;
}

.matcha-quick-view-modal {
    position: relative;
    width: 90%;
    max-width: 950px;
    max-height: 90vh;
    background: #fff;
    border-radius: var(--global-radius, 12px);
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
    transform: translateY(30px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
}
.matcha-quick-view-overlay.active .matcha-quick-view-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.quick-view-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    color: #333;
    transition: all 0.3s ease;
}
.quick-view-close:hover {
    background: #000;
    color: #fff;
    transform: rotate(90deg);
}

.matcha-quick-view-content {
    width: 100%;
    height: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.quick-view-inner-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 0;
    min-height: 500px;
}
@media(max-width: 768px) {
    .quick-view-inner-grid {
        grid-template-columns: 1fr;
    }
}

.quick-view-image {
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    position: relative;
}
.quick-view-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

.quick-view-summary {
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.quick-view-summary .product_title {
    font-family: var(--font-serif, "Playfair Display", serif);
    font-size: 32px;
    font-weight: 700;
    color: #111;
    margin-bottom: 15px;
    line-height: 1.2;
}
.quick-view-summary .price {
    font-size: 22px;
    color: var(--sage, #728c69);
    font-weight: 600;
    margin-bottom: 25px;
}
.quick-view-summary .woocommerce-product-details__short-description {
    font-size: 16px;
    line-height: 1.7;
    color: #666;
    margin-bottom: 30px;
}

/* Quick View Form Styling */
.quick-view-summary form.cart {
    margin-bottom: 30px;
}
.quick-view-summary table.variations {
    width: 100%;
    margin-bottom: 20px;
    border-collapse: separate;
    border-spacing: 0 15px;
}
.quick-view-summary table.variations td.label {
    width: 25%;
    vertical-align: middle;
    font-weight: 600;
    color: #333;
}
.quick-view-summary table.variations td.value {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}
.quick-view-summary table.variations select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: var(--global-radius, 6px);
    background: #fff;
    font-size: 14px;
    color: #333;
    outline: none;
    transition: border-color 0.3s ease;
}
.quick-view-summary table.variations select:focus {
    border-color: #000;
}
.quick-view-summary .reset_variations {
    display: inline-block;
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.2s;
}
.quick-view-summary .reset_variations:hover {
    color: var(--sage, #728c69);
}

.quick-view-summary .woocommerce-variation-add-to-cart,
.quick-view-summary .cart:not(.variations_form) {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.quick-view-summary .quantity {
    display: flex;
}
.quick-view-summary .quantity input {
    width: 70px;
    height: 50px;
    padding: 0 10px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: var(--global-radius, 6px);
    font-size: 16px;
    font-weight: 600;
    outline: none;
}
.quick-view-summary .single_add_to_cart_button {
    height: 50px;
    padding: 0 40px;
    background: var(--sage, #728c69);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-grow: 1;
}
.quick-view-summary .single_add_to_cart_button:hover {
    background: var(--sage-deep, #5a6e53);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.quick-view-meta {
    font-size: 13px;
    color: #888;
    border-top: 1px solid #f0f0f0;
    padding-top: 20px;
}
.quick-view-meta a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
}
.quick-view-meta a:hover {
    color: var(--sage, #728c69);
}


/* Quick View Loader */
.matcha-quick-view-loader {
    padding: 100px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 400px;
}
.matcha-quick-view-loader .spinner {
    animation: rotate 2s linear infinite;
    z-index: 2;
    width: 50px;
    height: 50px;
}
.matcha-quick-view-loader .spinner .path {
    stroke: var(--sage, #728c69);
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}
@keyframes rotate { 100% { transform: rotate(360deg); } }
@keyframes dash {
  0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
  50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
  100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

/* Quick View Button */
.matcha-quick-view-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(255,255,255,0.95);
    color: #000;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    z-index: 2;
}
.product:hover .matcha-quick-view-btn,
.shop-favorite-item:hover .matcha-quick-view-btn {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}
.matcha-quick-view-btn:hover {
    background: #000;
    color: #fff;
}

/* ==========================================================
   DARK MODE OVERRIDES
========================================================== */
body.dark-mode .matcha-mini-cart-drawer {
    background: #111;
    box-shadow: -10px 0 40px rgba(0,0,0,0.5);
}
body.dark-mode .mini-cart-header {
    background: #1a1a1a;
    border-bottom-color: #333;
}
body.dark-mode .mini-cart-header h3 {
    color: #fff;
}
body.dark-mode .mini-cart-close {
    color: #999;
}
body.dark-mode .mini-cart-close:hover {
    color: #fff;
}
body.dark-mode .mini-cart-body ul.cart_list li {
    border-bottom-color: #333;
}
body.dark-mode .mini-cart-body ul.cart_list li img {
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
body.dark-mode .woocommerce-mini-cart .cart_list li a.remove,
body.dark-mode .mini-cart-body ul.cart_list li .remove {
    background: #333 !important;
    color: #aaa !important;
}
body.dark-mode .woocommerce-mini-cart .cart_list li a.remove:hover,
body.dark-mode .mini-cart-body ul.cart_list li .remove:hover {
    background: #e74c3c !important;
    color: #fff !important;
}
body.dark-mode .mini-cart-body ul.cart_list li a {
    color: #eee;
}
body.dark-mode .mini-cart-body ul.cart_list li .quantity {
    color: #aaa;
}
body.dark-mode .mini-cart-body .total {
    border-top-color: #444;
    color: #fff;
}
body.dark-mode .mini-cart-body .buttons a.wc-forward {
    background: #333;
    color: #eee;
}
body.dark-mode .mini-cart-body .buttons a.wc-forward:hover {
    background: #444;
}
body.dark-mode .mini-cart-body .buttons a.checkout {
    background: #fff;
    color: #000;
}
body.dark-mode .mini-cart-body .buttons a.checkout:hover {
    background: var(--sage, #728c69);
    color: #fff;
}

/* Quick View Dark Mode */
body.dark-mode .matcha-quick-view-modal {
    background: #111;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}
body.dark-mode .quick-view-image {
    background: #0a0a0a;
}
body.dark-mode .quick-view-close {
    background: rgba(30, 30, 30, 0.9);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}
body.dark-mode .quick-view-close:hover {
    background: #000;
    color: var(--sage, #728c69);
}
body.dark-mode .quick-view-summary .product_title {
    color: #fff;
}
body.dark-mode .quick-view-summary .woocommerce-product-details__short-description {
    color: #bbb;
}
body.dark-mode .quick-view-summary table.variations td.label {
    color: #eee;
}
body.dark-mode .quick-view-summary table.variations select {
    background: #1a1a1a;
    border-color: #333;
    color: #fff;
}
body.dark-mode .quick-view-summary table.variations select:focus {
    border-color: #666;
}
body.dark-mode .quick-view-summary .quantity input {
    background: #1a1a1a;
    border-color: #333;
    color: #fff;
}
body.dark-mode .quick-view-summary .single_add_to_cart_button {
    background: #fff;
    color: #000;
}
body.dark-mode .quick-view-summary .single_add_to_cart_button:hover {
    background: var(--sage, #728c69);
    color: #fff;
}
body.dark-mode .quick-view-meta {
    border-top-color: #333;
    color: #777;
}
body.dark-mode .quick-view-meta a {
    color: #aaa;
}
body.dark-mode .quick-view-meta a:hover {
    color: var(--sage, #728c69);
}
