/* ==========================================================================
   AR TMC Woo Essentials — v1.4.2
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Product Loop: Action Buttons
   -------------------------------------------------------------------------- */
.woocommerce ul.products li.product {
    position: relative;
    overflow: visible;
}
.artmc-ess-action-buttons {
    position: absolute;
    top: 10px;
    right: -50px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 99;
    opacity: 0;
    transition: right 0.35s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.35s ease;
    pointer-events: none;
}
.woocommerce ul.products li.product:hover .artmc-ess-action-buttons {
    right: 10px;
    opacity: 1;
    pointer-events: auto;
}
[dir="rtl"] .artmc-ess-action-buttons                                           { right: auto; left: -50px; }
[dir="rtl"] .woocommerce ul.products li.product:hover .artmc-ess-action-buttons { left: 10px; right: auto; }

.artmc-btn-action {
    width: 36px;
    height: 36px;
    background: #fff;
    border: none;
    border-radius: 50%;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    font-size: 14px;
    line-height: 1;
}
.artmc-btn-action:hover  { background: #2271b1; color: #fff; transform: scale(1.12); }
.artmc-btn-action.added  { background: #d32f2f; color: #fff; }
.artmc-btn-action.loading i { animation: artmc-spin 1s infinite linear; }
@keyframes artmc-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   2. Header Icon Bar
   -------------------------------------------------------------------------- */
.artmc-header-icons-wrapper { display: flex; align-items: center; gap: 12px; }
.artmc-header-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s;
}
.artmc-header-icon:hover { opacity: 0.75; }
.artmc-icon-badge, .artmc-badge {
    position: absolute;
    top: -8px; right: -10px;
    min-width: 18px; height: 18px;
    background: #d32f2f; color: #fff;
    font-size: 10px; font-weight: 700;
    border-radius: 50px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px; line-height: 1;
}
[dir="rtl"] .artmc-icon-badge,
[dir="rtl"] .artmc-badge { right: auto; left: -10px; }

/* --------------------------------------------------------------------------
   3. Quick View Modal
   -------------------------------------------------------------------------- */
.artmc-modal-overlay {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 999999;
    display: flex; align-items: center; justify-content: center;
}
.artmc-modal-content {
    background: #fff; border-radius: 10px;
    max-width: 900px; width: 90%; padding: 30px;
    position: relative;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: artmc-qv-fadein 0.3s ease-out;
}
@keyframes artmc-qv-fadein { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.artmc-modal-close {
    position: absolute; top: 15px; right: 15px;
    z-index: 10; background: #f1f1f1; border: none;
    border-radius: 50%; width: 30px; height: 30px;
    cursor: pointer; font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.artmc-modal-close:hover { background: #ddd; }
#artmc-qv-modal.artmc-modal-overlay {
    --artmc-qv-primary: #0B1F4B;
    --artmc-qv-accent: #E1261C;
    --artmc-qv-accent-dark: #B81D15;
    --artmc-qv-muted: #4B5563;
    --artmc-qv-line: #E5E7EB;
    --artmc-qv-soft: #F5F7FA;
    position: fixed; inset: 0;
    background: rgba(11,31,75,0.62);
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
    z-index: 999999;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
#artmc-qv-modal .artmc-modal-content {
    background: #fff; border-radius: 16px;
    max-width: 960px; width: 100%; padding: 0;
    position: relative;
    box-shadow: 0 30px 80px rgba(11,31,75,0.35);
    max-height: calc(100vh - 48px); overflow: auto;
    animation: artmc-qv-in 0.28s cubic-bezier(.22,.61,.36,1);
}
@keyframes artmc-qv-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
#artmc-qv-modal .artmc-modal-close {
    position: absolute; top: 14px; inset-inline-end: 14px; right: auto;
    z-index: 10; background: #fff; border: 1px solid var(--artmc-qv-line);
    border-radius: 50%; width: 40px; height: 40px; padding: 0;
    cursor: pointer; font-size: 22px; line-height: 1; color: var(--artmc-qv-primary);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(11,31,75,0.10);
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
#artmc-qv-modal .artmc-modal-close:hover, #artmc-qv-modal .artmc-modal-close:focus-visible { background: var(--artmc-qv-primary); color: #fff; transform: rotate(90deg); }
#artmc-qv-modal .artmc-modal-close:focus-visible { outline: 3px solid #2F80ED; outline-offset: 2px; }
.artmc-qv-wrapper { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
.artmc-qv-image { width: auto; background: var(--artmc-qv-soft); padding: 32px; display: flex; flex-direction: column; gap: 14px; justify-content: center; border-start-start-radius: 16px; border-end-start-radius: 16px; }
.artmc-qv-main { background: #fff; border-radius: 12px; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.artmc-qv-image img, .artmc-qv-main img { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; }
.artmc-qv-thumbs { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.artmc-qv-thumb { width: 64px; height: 64px; padding: 4px; background: #fff; border: 2px solid transparent; border-radius: 10px; cursor: pointer; transition: border-color 0.2s; }
.artmc-qv-thumb img { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }
.artmc-qv-thumb.is-active, .artmc-qv-thumb:hover { border-color: var(--artmc-qv-primary); }
.artmc-qv-summary { width: auto; padding: 48px 36px 36px; display: flex; flex-direction: column; gap: 12px; text-align: start; }
.artmc-qv-cat { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--artmc-qv-accent-dark); }
.artmc-qv-summary .qv-title { margin: 0; font-size: 24px; line-height: 1.35; font-weight: 700; color: var(--artmc-qv-primary); padding-inline-end: 36px; }
.artmc-qv-sku { font-size: 14px; color: var(--artmc-qv-muted); }
.artmc-qv-sku span { color: var(--artmc-qv-primary); font-weight: 600; }
.artmc-qv-summary .price { font-size: 24px; font-weight: 700; color: var(--artmc-qv-primary); margin: 4px 0 0; }
.artmc-qv-summary .excerpt { font-size: 15px; color: var(--artmc-qv-muted); line-height: 1.75; margin: 0; padding-top: 12px; border-top: 1px solid var(--artmc-qv-line); max-height: 9em; overflow: auto; }
.artmc-qv-summary .excerpt p { margin: 0 0 8px; }
.artmc-qv-actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 16px; }
.artmc-qv-actions .button, .artmc-qv-actions form.cart .button { width: 100%; display: flex !important; align-items: center; justify-content: center; min-height: 48px; margin: 0 !important; border-radius: 10px !important; font-weight: 600; text-align: center; box-sizing: border-box; }
.artmc-qv-actions form.cart { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.artmc-qv-actions .artmc-qv-quote.is-secondary { background: #fff !important; color: var(--artmc-qv-primary) !important; border: 1.5px solid var(--artmc-qv-primary) !important; }
.artmc-qv-actions .artmc-qv-quote.is-secondary:hover { background: var(--artmc-qv-primary) !important; color: #fff !important; }
.artmc-qv-actions .added_to_cart { text-align: center; font-size: 14px; }
.artmc-qv-full-details { display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin-top: 4px; font-weight: 600; font-size: 15px; color: var(--artmc-qv-primary) !important; text-decoration: none; padding: 8px; border-radius: 8px; }
.artmc-qv-full-details:hover { color: var(--artmc-qv-accent-dark) !important; background: var(--artmc-qv-soft); }
[dir="rtl"] .artmc-qv-full-details span, .rtl .artmc-qv-full-details span { display: inline-block; transform: scaleX(-1); }
body.artmc-qv-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { #artmc-qv-modal .artmc-modal-content { animation: none; } #artmc-qv-modal .artmc-modal-close:hover { transform: none; } }
@media (max-width: 767px) {
    #artmc-qv-modal.artmc-modal-overlay { padding: 12px; align-items: flex-end; }
    #artmc-qv-modal .artmc-modal-content { max-height: calc(100vh - 24px); border-radius: 16px; padding: 0; width: 100%; }
    #artmc-qv-modal .artmc-qv-wrapper { grid-template-columns: minmax(0, 1fr); }
    #artmc-qv-modal .artmc-qv-image { padding: 20px; border-radius: 16px 16px 0 0; }
    #artmc-qv-modal .artmc-qv-main { aspect-ratio: 4 / 3; }
    #artmc-qv-modal .artmc-qv-summary { padding: 20px; }
    #artmc-qv-modal .artmc-qv-summary .qv-title { font-size: 20px; }
}


/* --------------------------------------------------------------------------
   4. Compare Table — Desktop
   -------------------------------------------------------------------------- */
.artmc-compare-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
    margin-bottom: 20px;
    /* Ensure scrollbar always visible on mobile */
    scrollbar-width: thin;
    scrollbar-color: #bbb #f1f1f1;
}
.artmc-compare-table-wrapper::-webkit-scrollbar       { height: 6px; }
.artmc-compare-table-wrapper::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
.artmc-compare-table-wrapper::-webkit-scrollbar-thumb { background: #bbb; border-radius: 3px; }

.artmc-compare-table {
    min-width: 900px;
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    text-align: center;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}
.artmc-compare-table th,
.artmc-compare-table td        { padding: 15px; border: 1px solid #eee; vertical-align: middle; }
.artmc-compare-table th        { width: 20%; background: #f9f9f9; text-align: start; font-weight: 600; }
.artmc-compare-item-wrapper    { position: relative; }
.artmc-remove-compare-item     { position: absolute; top: 10px; right: 10px; color: #d32f2f; font-size: 18px; text-decoration: none; line-height: 1; }
[dir="rtl"] .artmc-remove-compare-item { right: auto; left: 10px; }

/* --------------------------------------------------------------------------
   5. Wishlist Table — Desktop
   -------------------------------------------------------------------------- */
.artmc-wishlist-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
    scrollbar-width: thin;
    scrollbar-color: #bbb #f1f1f1;
}
.artmc-wishlist-table-wrapper::-webkit-scrollbar       { height: 6px; }
.artmc-wishlist-table-wrapper::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
.artmc-wishlist-table-wrapper::-webkit-scrollbar-thumb { background: #bbb; border-radius: 3px; }

.artmc-wishlist-table {
    width: 100%;
    min-width: 700px;  /* forces horizontal scroll on small screens */
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}
[dir="rtl"] .artmc-wishlist-table { text-align: right; }
.artmc-wishlist-table th         { padding: 15px; border-bottom: 2px solid #eee; font-weight: 600; white-space: nowrap; }
.artmc-wishlist-table td         { padding: 15px; border-bottom: 1px solid #eee; vertical-align: middle; }
.artmc-wishlist-table .product-thumbnail     { width: 80px; }
.artmc-wishlist-table .product-thumbnail img { max-width: 60px; height: auto; }
.artmc-wishlist-table .product-remove        { text-align: center; width: 40px; }

/* --------------------------------------------------------------------------
   6. Shared: Stock / Quote labels
   -------------------------------------------------------------------------- */
.artmc-stock-in   { color: #27ae60; font-weight: 700; }
.artmc-stock-out  { color: #d32f2f; font-weight: 700; }
.artmc-quote-only { color: #d32f2f; font-size: 13px; display: block; }

/* --------------------------------------------------------------------------
   7. Action cells
   -------------------------------------------------------------------------- */
.artmc-actions-cell              { display: flex; flex-direction: column; gap: 5px; }
.artmc-actions-cell .button      { width: 100%; text-align: center; white-space: nowrap; }
.artmc-add-to-quote              { background: #333 !important; color: #fff !important; border-color: #333 !important; }
.artmc-add-to-quote:hover        { background: #555 !important; }

/* --------------------------------------------------------------------------
   8. Clear buttons
   -------------------------------------------------------------------------- */
button.artmc-clear-compare,
button.artmc-clear-wishlist {
    background: #d32f2f; color: #fff;
    border-color: #d32f2f; cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
button.artmc-clear-compare:hover,
button.artmc-clear-wishlist:hover { background: #b71c1c; border-color: #b71c1c; }

a.artmc-clear-cart-btn {
    background-color: #d32f2f; color: #fff;
    border: none; padding: 10px 20px;
    font-weight: 700; text-transform: uppercase;
    cursor: pointer; display: inline-block;
    text-decoration: none; margin-inline-end: 15px;
    border-radius: 4px; transition: background 0.3s; line-height: normal;
}
a.artmc-clear-cart-btn:hover { background-color: #b71c1c; color: #fff; }

/* --------------------------------------------------------------------------
   9. Empty State / Guest Notice
   -------------------------------------------------------------------------- */
.artmc-empty-message             { text-align: center; padding: 50px 0; color: #999; }
.artmc-empty-message i           { font-size: 3em; color: #ccc; margin-bottom: 15px; display: block; }
.artmc-empty-message p           { font-size: 16px; }
.artmc-guest-notice              { background: #e3f2fd; color: #0d47a1; padding: 10px 15px; border-radius: 5px; margin-bottom: 20px; font-size: 14px; }
.artmc-guest-notice a            { font-weight: 700; color: #0277bd; text-decoration: underline; }

/* --------------------------------------------------------------------------
   10. MOBILE — full responsive overrides
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {

    /* Quick View */
    .artmc-qv-wrapper                 { flex-direction: column; }
    .artmc-qv-image, .artmc-qv-summary{ width: 100%; }
    .artmc-modal-content              { max-height: 90vh; overflow-y: auto; padding: 20px; }

    /* Product loop buttons: always visible (no hover on touch) */
    .artmc-ess-action-buttons {
        right: 8px !important;
        left: auto !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    [dir="rtl"] .artmc-ess-action-buttons { right: auto !important; left: 8px !important; }

    /* Empty Cart button */
    a.artmc-clear-cart-btn {
        width: 100%; margin-bottom: 10px;
        margin-inline-end: 0; display: block;
        text-align: center; box-sizing: border-box;
    }

    /* ── Compare Table Mobile ───────────────── */
    /*
     * Strategy: keep table layout, enforce horizontal scroll on the wrapper.
     * Min-width ensures columns don't collapse to zero.
     * Header column (th) fixed width so label is always readable.
     */
    .artmc-compare-table-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        border: 1px solid #eee;
        border-radius: 6px;
    }
    .artmc-compare-table          { min-width: 600px; }
    .artmc-compare-table th       { min-width: 120px; max-width: 140px; width: 120px; font-size: 12px; }
    .artmc-compare-table td       { min-width: 140px; font-size: 13px; }
    .artmc-compare-table th,
    .artmc-compare-table td       { padding: 10px 8px; }
    .artmc-compare-table td img   { max-width: 80px !important; height: auto; }
    .artmc-actions-cell           { gap: 4px; }
    .artmc-actions-cell .button   { font-size: 12px; padding: 6px 8px; white-space: normal; }

    /* ── Wishlist Table Mobile ──────────────── */
    .artmc-wishlist-table-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        border: 1px solid #eee;
        border-radius: 6px;
    }
    .artmc-wishlist-table         { min-width: 580px; }
    .artmc-wishlist-table th,
    .artmc-wishlist-table td      { padding: 10px 8px; font-size: 13px; white-space: normal; }
    .artmc-wishlist-table .product-thumbnail img { max-width: 50px; }
    .artmc-wishlist-table .product-name { min-width: 120px; }
    .artmc-wishlist-table .product-add-to-cart { min-width: 140px; }
}

@media (max-width: 480px) {
    .artmc-compare-table th,
    .artmc-compare-table td,
    .artmc-wishlist-table th,
    .artmc-wishlist-table td    { padding: 8px 6px; font-size: 12px; }
    .artmc-compare-table        { min-width: 520px; }
    .artmc-wishlist-table       { min-width: 500px; }
    .artmc-modal-content        { padding: 15px; width: 95%; }
}

/* --------------------------------------------------------------------------
   11. Wishlist Guest Notice (Enhanced)
   -------------------------------------------------------------------------- */
.artmc-guest-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #e3f2fd;
    color: #0d47a1;
    padding: 14px 18px;
    border-radius: 6px;
    border-left: 4px solid #1976d2;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
}
[dir="rtl"] .artmc-guest-notice { border-left: none; border-right: 4px solid #1976d2; }

.artmc-notice-icon {
    font-size: 20px;
    margin-top: 2px;
    flex-shrink: 0;
    color: #1976d2;
}
.artmc-notice-text p   { margin: 0 0 4px 0; }
.artmc-notice-text p:last-child { margin-bottom: 0; }
.artmc-notice-link     { font-weight: 700; color: #0277bd; text-decoration: underline; }
.artmc-notice-link:hover { color: #01579b; }
