/* madaf-product-page — mpp.css v1.1.0 (Madaf All single-product, site-styled) */

.mpp-wrap {
    /* Remapped to the Madaf All brand palette (navy + blue). */
    --mpp-navy: #1C214D;
    --mpp-blue: #2563EB;
    --mpp-blue-d: #1D4ED8;
    --mpp-green: #12B76A;
    --mpp-gold: #B45309;
    --mpp-gray: #666E85;
    --mpp-border: #E3E7EF;
    --mpp-bg: #F5F7FB;
    --mpp-ease: cubic-bezier(0.23, 1, 0.32, 1);

    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
    font-family: inherit;
    color: var(--mpp-navy);
}
.mpp-wrap.mpp-side-left { direction: rtl; }
.mpp-wrap.mpp-side-left .mpp-gallery { order: 2; }
.mpp-wrap.mpp-side-left .mpp-summary { order: 1; }

/* ── Gallery ─────────────────────────────────────────── */
.mpp-gallery-main {
    position: relative;
    background: #fff;
    border: 1px solid #E3E7EF;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(28, 33, 77, 0.10);
}
.mpp-gallery-main img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    padding: 18px;
    box-sizing: border-box;
    transition: opacity 0.2s ease;
}
.mpp-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.3px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.mpp-badge--stock { background: var(--mpp-green); }
.mpp-badge--oos   { background: var(--mpp-gray); }
.mpp-badge--sale  { background: #DC2626; right: auto; left: 12px; }

.mpp-gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.mpp-thumb {
    width: 66px;
    height: 66px;
    padding: 4px;
    border: 1.5px solid var(--mpp-border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.12s var(--mpp-ease);
}
.mpp-thumb img { width: 100%; height: 100%; object-fit: contain; }
.mpp-thumb:hover { border-color: #DBEAFE; }
.mpp-thumb.is-active { border-color: var(--mpp-blue); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18); }
.mpp-thumb:active { transform: scale(0.96); }

/* ── Summary ─────────────────────────────────────────── */
.mpp-title {
    margin: 0 0 10px;
    font-size: 28px;
    line-height: 1.25;
    font-weight: 800;
    color: var(--mpp-navy);
    letter-spacing: -0.01em;
}
.mpp-rating { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 14px; }
.mpp-rating-count { color: var(--mpp-gray); font-size: 13px; }

.mpp-price {
    font-size: 33px;
    font-weight: 800;
    color: var(--mpp-navy);
    line-height: 1.1;
    margin-top: 6px;
}
.mpp-price .amount { font-weight: 800; }
.mpp-price del { color: var(--mpp-gray); font-weight: 600; font-size: 0.62em; margin-inline-start: 8px; }
.mpp-price ins { text-decoration: none; }
.mpp-price-prefix {
    font-size: 14px;
    font-weight: 700;
    color: var(--mpp-gray);
    vertical-align: middle;
    margin-inline-end: 4px;
}
.mpp-price--exact { color: var(--mpp-blue-d); }
.mpp-price-vat { font-size: 12px; color: var(--mpp-gray); margin-top: 4px; }

/* ── Dimensions + spec chips + stock (summary quick-facts) ── */
.mpp-dims { margin: 0 0 12px; font-size: 17px; font-weight: 700; color: var(--mpp-blue-d); letter-spacing: .02em; }
.mpp-specs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.mpp-specs li { display: inline-flex; align-items: center; gap: 6px; background: var(--mpp-bg); border: 1px solid var(--mpp-border); border-radius: 999px; padding: 7px 13px; font-size: 13.5px; font-weight: 600; color: var(--mpp-navy); }
.mpp-specs li::before { content: "✓"; color: var(--mpp-blue); font-weight: 800; font-size: 12px; }
.mpp-stock { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 14px; font-weight: 700; }
.mpp-stock::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.mpp-stock--in { color: var(--mpp-green); }
.mpp-stock--out { color: var(--mpp-gray); }
.mpp-var-hint {
    margin: 10px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--mpp-gold);
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 8px;
    padding: 7px 12px;
    display: inline-block;
}

.mpp-short-desc {
    margin: 16px 0 0;
    font-size: 15px;
    line-height: 1.65;
    color: #374151;
}
.mpp-short-desc p { margin: 0 0 8px; }
.mpp-short-desc ul { margin: 8px 0; padding-inline-start: 20px; }

/* ── Cart / variations (restyle the native WooCommerce form) ── */
.mpp-cart { margin: 20px 0 0; }
.mpp-cart .variations {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 14px;
}
.mpp-cart .variations tr { display: flex; flex-direction: column; margin-bottom: 12px; }
.mpp-cart .variations th {
    text-align: start;
    font-size: 13px;
    font-weight: 700;
    color: var(--mpp-navy);
    padding: 0 0 5px;
}
.mpp-cart .variations td { padding: 0; }
.mpp-cart .variations select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #C9CFDC;
    border-radius: 10px;
    font-size: 15px;
    background: #fff;
    color: var(--mpp-navy);
    direction: rtl;
}
.mpp-cart .variations select:focus { outline: 2px solid var(--mpp-blue); border-color: transparent; }
.mpp-cart .reset_variations {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--mpp-gray);
}

/* Hide WooCommerce's native variation price — our hero .mpp-price is the single source */
.mpp-cart .woocommerce-variation-price,
.mpp-cart .woocommerce-variation-availability { display: none !important; }
.mpp-cart .woocommerce-variation.single_variation { margin-bottom: 10px; }

/* Quantity + add-to-cart row */
.mpp-cart form.cart {
    display: flex;
    align-items: stretch;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0;
}
/* Quantity stepper — +/− around the native qty input (like the home grid) */
.mpp-cart .quantity {
    display: inline-flex;
    align-items: stretch;
    border: 1.5px solid #C9CFDC;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    flex: 0 0 auto;
    height: 52px;
}
.mpp-qty-btn {
    width: 44px;
    border: none;
    background: #fff;
    color: var(--mpp-navy);
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    transition: background 0.15s;
}
.mpp-qty-btn:hover { background: #E3E7EF; }
.mpp-qty-btn:active { background: #DBEAFE; }
.mpp-qty-btn:disabled { opacity: 0.35; cursor: not-allowed; background: #fff; }
.mpp-cart .quantity input.qty {
    width: 50px;
    border: none;
    border-inline: 1.5px solid #E3E7EF;
    border-radius: 0;
    text-align: center;
    font-size: 16px;
    font-weight: 800;
    color: var(--mpp-navy);
    background: #fff;
    padding: 0;
    -moz-appearance: textfield;
    appearance: textfield;
}
.mpp-cart .quantity input.qty:focus { outline: none; }
.mpp-cart .quantity input.qty::-webkit-outer-spin-button,
.mpp-cart .quantity input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.mpp-cart button.single_add_to_cart_button,
.mpp-cart .single_add_to_cart_button,
.mpp-cart form.cart button[type="submit"] {
    flex: 1;
    min-width: 200px;
    min-height: 52px;
    padding: 14px 20px;
    background: var(--mpp-blue) !important;
    background-image: none !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.2px;
    text-shadow: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transition: background 0.18s, transform 0.14s var(--mpp-ease), box-shadow 0.18s;
}
.mpp-cart button.single_add_to_cart_button:hover,
.mpp-cart .single_add_to_cart_button:hover {
    background: var(--mpp-blue-d) !important;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
    transform: translateY(-1px);
}
.mpp-cart .single_add_to_cart_button:active { transform: scale(0.98); }
.mpp-cart .single_add_to_cart_button.disabled,
.mpp-cart .single_add_to_cart_button:disabled {
    background: #C9CFDC !important;
    color: #fff !important;
    opacity: 0.7;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ── Meta ────────────────────────────────────────────── */
.mpp-meta {
    margin: 18px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--mpp-border);
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    font-size: 13px;
    color: var(--mpp-gray);
}
.mpp-meta a { color: var(--mpp-blue); text-decoration: none; }
.mpp-meta a:hover { text-decoration: underline; }

/* ── Trust row ───────────────────────────────────────── */
.mpp-trust {
    list-style: none;
    margin: 16px 0 0;
    padding: 14px 16px;
    background: var(--mpp-bg);
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    display: grid;
    gap: 9px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}
.mpp-trust li { display: flex; align-items: center; gap: 4px; }

.mpp-whatsapp {
    display: block;
    margin-top: 12px;
    text-align: center;
    padding: 12px;
    border-radius: 10px;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    color: #047857;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.15s;
}
.mpp-whatsapp:hover { background: #D1FAE5; }

.mpp-empty {
    padding: 40px;
    text-align: center;
    color: var(--mpp-gray);
    border: 2px dashed var(--mpp-border);
    border-radius: 12px;
    font-size: 14px;
}

/* ── Tabs (full-width, below the two columns) ──────────── */
.mpp-tabs-wrap {
    order: 3;
    grid-column: 1 / -1;
    margin-top: 36px;
}
.mpp-tablist {
    position: relative;
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--mpp-border);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.mpp-tablist::-webkit-scrollbar { display: none; }
.mpp-tab {
    flex: 0 0 auto;
    padding: 12px 18px;
    background: none;
    border: 0;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    color: var(--mpp-gray);
    white-space: nowrap;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: color 0.15s ease, background 0.15s ease;
}
.mpp-tab:hover { color: var(--mpp-navy); }
.mpp-tab[aria-selected="true"] { color: var(--mpp-blue-d); }
.mpp-tab:focus-visible {
    outline: 2px solid var(--mpp-blue);
    outline-offset: -2px;
}
/* Moving underline indicator — GPU transform only, direction-agnostic (JS sets the vars) */
.mpp-tab-ink {
    position: absolute;
    bottom: -1px;
    height: 2.5px;
    width: var(--mpp-ink-w, 0);
    transform: translateX(var(--mpp-ink-x, 0));
    background: var(--mpp-blue);
    border-radius: 3px 3px 0 0;
    transition: transform 0.25s var(--mpp-ease), width 0.25s var(--mpp-ease);
    will-change: transform, width;
    pointer-events: none;
}
.mpp-tabpanels { padding-top: 22px; }
.mpp-tabpanel { animation: mpp-panel-in 0.22s var(--mpp-ease); }
.mpp-tabpanel[hidden] { display: none; }
.mpp-tabpanel:focus-visible { outline: 2px solid var(--mpp-blue); outline-offset: 4px; border-radius: 6px; }
@keyframes mpp-panel-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Shared rich-text styling (tab content) ────────────── */
.mpp-rte {
    font-size: 15px;
    line-height: 1.75;
    color: #374151;
}
.mpp-rte p  { margin: 0 0 12px; }
.mpp-rte ul,
.mpp-rte ol { margin: 0 0 12px; padding-inline-start: 22px; }
.mpp-rte li { margin-bottom: 6px; }
.mpp-rte img { max-width: 100%; height: auto; border-radius: 10px; }
.mpp-rte table { width: 100%; border-collapse: collapse; }
.mpp-rte th,
.mpp-rte td { padding: 8px 10px; border: 1px solid var(--mpp-border); text-align: start; }
.mpp-rte > :first-child { margin-top: 0; }
.mpp-rte > :last-child  { margin-bottom: 0; }
.mpp-details-lead {
    font-weight: 600;
    color: var(--mpp-navy);
    margin-bottom: 14px;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 880px) {
    /* minmax(0,…) — not bare 1fr — so wide tab content (nowrap tab strip, tables,
       long strings) can't force the grid track past the viewport (RTL overflow guard). */
    .mpp-wrap { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .mpp-wrap.mpp-side-left .mpp-gallery,
    .mpp-wrap.mpp-side-left .mpp-summary { order: 0; }
    .mpp-title { font-size: 23px; }
    .mpp-price { font-size: 26px; }
    .mpp-cart form.cart { flex-direction: column; }
    .mpp-cart .single_add_to_cart_button { min-width: 0; width: 100%; }
    .mpp-cart .quantity { align-self: stretch; justify-content: center; }
    .mpp-cart .quantity input.qty { flex: 1; width: auto; }
    .mpp-tabs-wrap { margin-top: 24px; }
    .mpp-tab { padding: 11px 14px; font-size: 14px; }
    /* Hint that the tab strip scrolls — fade its trailing (left, in RTL) edge */
    .mpp-tablist {
        -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 24px), transparent);
        mask-image: linear-gradient(to left, #000 calc(100% - 24px), transparent);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mpp-thumb, .mpp-qty-btn, .mpp-single_add_to_cart_button, .mpp-cart .single_add_to_cart_button,
    .mpp-tab, .mpp-tab-ink { transition: none; }
    .mpp-tabpanel { animation: none; }
}
