/**
 * 1805 Mart Plugin — Frontend Stylesheet v2.0.0
 *
 * Fully self-contained. Works with any WordPress theme.
 * Uses CSS custom properties so colors can be overridden by theme if desired.
 */

/* ── Design tokens ─────────────────────────────────────────────────────────── */
:root {
    --mc-primary:    #e63946;
    --mc-primary-dk: #c22d38;
    --mc-green:      #25D366;
    --mc-black:      #111;
    --mc-gray-dk:    #444;
    --mc-gray:       #888;
    --mc-gray-lt:    #ccc;
    --mc-border:     #e5e5e5;
    --mc-bg:         #f4f4f4;
    --mc-white:      #fff;
    --mc-radius:     8px;
    --mc-radius-lg:  16px;
    --mc-shadow:     0 2px 12px rgba(0,0,0,.08);
    --mc-shadow-lg:  0 8px 32px rgba(0,0,0,.12);
    --mc-font:       -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Base ──────────────────────────────────────────────────────────────────── */
.mc-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    font-family: var(--mc-font);
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.mc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--mc-radius);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .1s;
    text-decoration: none;
    width: 100%;
    box-sizing: border-box;
}
.mc-btn:active { transform: scale(.98); }
.mc-btn--primary {
    background: var(--mc-primary);
    color: var(--mc-white);
}
.mc-btn--primary:hover { background: var(--mc-primary-dk); color: #fff; }
.mc-btn--whatsapp {
    background: var(--mc-green);
    color: var(--mc-white);
}
.mc-btn--whatsapp:hover { background: #1da851; color: #fff; }

/* Add-to-cart button (product pages) */
.mc-btn--add-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: var(--mc-primary);
    color: #fff;
    border: none;
    border-radius: var(--mc-radius);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    flex: 1;
    transition: background .2s;
}
.mc-btn--add-cart:hover { background: var(--mc-primary-dk); }
.mc-btn--add-cart:disabled { background: var(--mc-gray-lt); cursor: not-allowed; }

/* ── Form fields ───────────────────────────────────────────────────────────── */
.mc-field {
    margin-bottom: 14px;
}
.mc-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--mc-gray-dk);
    margin-bottom: 5px;
}
.mc-field input,
.mc-field textarea,
.mc-field select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--mc-border);
    border-radius: var(--mc-radius);
    font-size: 14px;
    font-family: var(--mc-font);
    background: var(--mc-white);
    box-sizing: border-box;
    transition: border-color .2s;
    color: var(--mc-black);
}
.mc-field input:focus,
.mc-field textarea:focus,
.mc-field select:focus {
    outline: none;
    border-color: var(--mc-primary);
    box-shadow: 0 0 0 3px rgba(230,57,70,.1);
}
.mc-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 480px) {
    .mc-form-grid { grid-template-columns: 1fr; }
}

/* ── Card ──────────────────────────────────────────────────────────────────── */
.mc-card {
    background: var(--mc-white);
    border-radius: var(--mc-radius-lg);
    padding: 24px;
    box-shadow: var(--mc-shadow);
    margin-bottom: 20px;
}
.mc-card__title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--mc-border);
}

/* ── Toast notification ────────────────────────────────────────────────────── */
#mcp-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #222;
    color: #fff;
    padding: 12px 24px;
    border-radius: 99px;
    font-size: 14px;
    font-weight: 600;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s, transform .3s;
    white-space: nowrap;
    max-width: 90vw;
    text-align: center;
}
#mcp-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#mcp-toast.success { background: #1a7a4a; }
#mcp-toast.error   { background: var(--mc-primary); }

/* ── Spinner ───────────────────────────────────────────────────────────────── */
.mcp-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mcp-spin .6s linear infinite;
}
@keyframes mcp-spin { to { transform: rotate(360deg); } }

/* ── Price "Contact for Price" ─────────────────────────────────────────────── */
.mc-contact-price {
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    color: var(--mc-gray);
    background: #f5f5f5;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px dashed var(--mc-gray-lt);
}

/* ── Status badges ─────────────────────────────────────────────────────────── */
.mc-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
}
.mc-status-badge.pending    { background: #fff3cd; color: #856404; }
.mc-status-badge.processing { background: #d1ecf1; color: #0c5460; }
.mc-status-badge.completed  { background: #d4edda; color: #155724; }
.mc-status-badge.cancelled,
.mc-status-badge.failed     { background: #f8d7da; color: #721c24; }
.mc-status-badge.on-hold    { background: #e2e3e5; color: #383d41; }
.mc-status-badge.refunded   { background: #e2e3e5; color: #383d41; }

/* ── Product Info (single page) ────────────────────────────────────────────── */
.mc-product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin: 20px 0 32px;
    align-items: start;
}
@media (max-width: 700px) {
    .mc-product-layout { grid-template-columns: 1fr; }
}

.mc-product-gallery__main {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--mc-radius-lg);
    overflow: hidden;
    background: #f5f5f5;
    position: relative;
}
.mc-product-gallery__main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mc-product-gallery__thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.mc-product-gallery__thumb {
    width: 64px;
    height: 64px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color .2s;
}
.mc-product-gallery__thumb.active,
.mc-product-gallery__thumb:hover { border-color: var(--mc-primary); }
.mc-product-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }

.mc-product-info__title {
    font-size: 22px;
    font-weight: 800;
    color: var(--mc-black);
    margin: 0 0 8px;
    line-height: 1.3;
}
.mc-product-info__price {
    font-size: 28px;
    font-weight: 800;
    color: var(--mc-primary);
}
.mc-product-info__original {
    font-size: 16px;
    color: var(--mc-gray);
    text-decoration: line-through;
}
.mc-product-info__savings {
    font-size: 13px;
    color: #1a7a4a;
    font-weight: 600;
    margin-top: 4px;
}
.mc-product-info__stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 600;
    margin: 12px 0;
}
.mc-product-info__stock.instock { background: #d4edda; color: #155724; }
.mc-product-info__stock.low     { background: #fff3cd; color: #856404; }
.mc-product-info__stock.outofstock { background: #f8d7da; color: #721c24; }

.mc-product-info__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.mc-qty-control {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--mc-border);
    border-radius: var(--mc-radius);
    overflow: hidden;
    background: var(--mc-white);
}
.mc-qty-control input[type="number"] {
    width: 52px;
    text-align: center;
    border: none;
    font-size: 15px;
    font-weight: 700;
    padding: 0;
    -moz-appearance: textfield;
}
.mc-qty-control input::-webkit-outer-spin-button,
.mc-qty-control input::-webkit-inner-spin-button { -webkit-appearance: none; }
.mmt-qty-minus,
.mmt-qty-plus {
    background: none;
    border: none;
    padding: 0 14px;
    height: 44px;
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
    color: var(--mc-gray-dk);
    transition: background .2s;
}
.mmt-qty-minus:hover,
.mmt-qty-plus:hover { background: var(--mc-bg); }

/* ── Auth (login / register) ───────────────────────────────────────────────── */
.mc-auth-wrap {
    max-width: 440px;
    margin: 40px auto;
    padding: 0 16px;
    font-family: var(--mc-font);
}
.mc-auth-card {
    background: var(--mc-white);
    border-radius: var(--mc-radius-lg);
    box-shadow: var(--mc-shadow-lg);
    overflow: hidden;
}
.mc-auth-head {
    background: var(--mc-primary);
    color: #fff;
    padding: 28px 28px 20px;
}
.mc-auth-head h2 { margin: 0 0 4px; font-size: 22px; font-weight: 800; }
.mc-auth-head p  { margin: 0; font-size: 14px; opacity: .85; }
.mc-auth-body {
    padding: 28px;
}
.mc-auth-switch {
    text-align: center;
    margin-top: 18px;
    font-size: 14px;
    color: var(--mc-gray);
}
.mc-auth-switch a {
    color: var(--mc-primary);
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

/* ── Account dashboard ─────────────────────────────────────────────────────── */
.mc-account-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    padding: 24px 0;
    align-items: start;
}
@media (max-width: 640px) {
    .mc-account-layout { grid-template-columns: 1fr; }
}

.mc-account-sidebar {
    background: var(--mc-white);
    border-radius: var(--mc-radius-lg);
    box-shadow: var(--mc-shadow);
    overflow: hidden;
}
.mc-account-user {
    background: var(--mc-primary);
    color: #fff;
    padding: 20px;
    text-align: center;
}
.mc-account-user__avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,.4);
    margin-bottom: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    object-fit: cover;
}
.mc-account-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--mc-gray-dk);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background .2s, border-color .2s;
}
.mc-account-nav a:hover { background: #fef2f2; }
.mc-account-nav a.active { border-color: var(--mc-primary); color: var(--mc-primary); background: #fff5f5; }

.mc-account-content {
    background: var(--mc-white);
    border-radius: var(--mc-radius-lg);
    box-shadow: var(--mc-shadow);
    padding: 24px;
    min-height: 300px;
}

/* ── Orders table ──────────────────────────────────────────────────────────── */
.mc-orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.mc-orders-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--mc-gray);
    border-bottom: 2px solid var(--mc-border);
}
.mc-orders-table td {
    padding: 12px;
    border-bottom: 1px solid var(--mc-border);
    vertical-align: middle;
}
.mc-orders-table tr:last-child td { border-bottom: none; }

/* ── Cart items ────────────────────────────────────────────────────────────── */
.mc-cart-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--mc-border);
}
.mc-cart-item:last-child { border-bottom: none; }
.mc-cart-item__image {
    width: 70px;
    height: 70px;
    border-radius: var(--mc-radius);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--mc-bg);
}
.mc-cart-item__image img { width: 100%; height: 100%; object-fit: cover; }
.mc-cart-item__info { flex: 1; min-width: 0; }
.mc-cart-item__name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.mc-cart-item__price { font-size: 14px; color: var(--mc-primary); font-weight: 700; margin-bottom: 8px; }
.mc-cart-item__qty { display: flex; align-items: center; gap: 8px; }
.mc-qty-btn {
    width: 28px; height: 28px;
    background: var(--mc-bg);
    border: 1px solid var(--mc-border);
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.mc-qty-inp { width: 40px; text-align: center; border: 1px solid var(--mc-border); border-radius: 4px; padding: 4px; font-size: 13px; }
.mc-cart-item__remove { background: none; border: none; color: var(--mc-gray); font-size: 12px; cursor: pointer; margin-top: 6px; padding: 0; }
.mc-cart-item__remove:hover { color: var(--mc-primary); }

/* ── Checkout ──────────────────────────────────────────────────────────────── */
.mc-checkout-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    padding: 20px 0;
    align-items: start;
}
@media (max-width: 768px) {
    .mc-checkout-layout { grid-template-columns: 1fr; }
}
.mc-payment-opt {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1.5px solid var(--mc-border);
    border-radius: var(--mc-radius);
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color .2s;
}
.mc-payment-opt input[type="radio"] { flex-shrink: 0; accent-color: var(--mc-primary); }
.mc-payment-opt:hover { border-color: var(--mc-primary); }
.mc-payment-opt.selected { border-color: var(--mc-primary); background: #fff5f5; }
.mc-payment-opt div > strong { display: block; font-size: 14px; }
.mc-payment-opt div > span   { font-size: 12px; color: var(--mc-gray); }

/* ── Product card (plugin-rendered) ────────────────────────────────────────── */
.mc-product-card {
    background: var(--mc-white);
    border-radius: var(--mc-radius-lg);
    box-shadow: var(--mc-shadow);
    overflow: hidden;
    transition: box-shadow .2s;
}
.mc-product-card:hover { box-shadow: var(--mc-shadow-lg); }
.mc-product-card__image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--mc-bg);
}
.mc-product-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.mc-product-card:hover .mc-product-card__image img { transform: scale(1.04); }
.mc-product-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--mc-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 99px;
}
.mc-product-card__body { padding: 14px; }
.mc-product-card__name a { font-size: 14px; font-weight: 600; color: var(--mc-black); text-decoration: none; display: block; margin-bottom: 6px; }
.mc-product-card__price { font-size: 16px; font-weight: 800; color: var(--mc-primary); }
.mc-product-card__original { font-size: 12px; color: var(--mc-gray); text-decoration: line-through; margin-left: 6px; }
.mc-product-card__actions { display: flex; gap: 8px; margin-top: 10px; }
.mc-product-card__add-btn {
    flex: 1;
    padding: 10px;
    background: var(--mc-primary);
    color: #fff;
    border: none;
    border-radius: var(--mc-radius);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: background .2s;
}
.mc-product-card__add-btn:hover { background: var(--mc-primary-dk); }
.mc-product-card__add-btn:disabled { background: var(--mc-gray-lt); cursor: not-allowed; }
.mc-product-card__wa-btn {
    padding: 10px 12px;
    background: var(--mc-green);
    color: #fff;
    border-radius: var(--mc-radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 16px;
    transition: background .2s;
}
.mc-product-card__wa-btn:hover { background: #1da851; }

/* ── Section headers ───────────────────────────────────────────────────────── */
.mc-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.mc-section__title {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    border-left: 4px solid var(--mc-primary);
    padding-left: 12px;
}
.mc-section__see-all {
    font-size: 13px;
    color: var(--mc-primary);
    font-weight: 600;
    text-decoration: none;
}

/* ── Responsive utilities ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .mc-card { padding: 16px; }
    .mc-product-info__title { font-size: 18px; }
    .mc-account-content { padding: 16px; }
}
