/* === Moshkovits Shop - Frontend (Themable) === */

.msh-shop {
    /* CSS Variables - ניתנים לעקיפה דרך הגדרות גלובליות או widget אלמנטור */
    --msh-primary:        #1a1a1a;
    --msh-primary-text:   #ffffff;
    --msh-accent:         #185fa5;
    --msh-bg:             #ffffff;
    --msh-surface:        #f7f7f4;
    --msh-border:         #e6e6e2;
    --msh-text:           #2c2c2a;
    --msh-text-muted:     #6b6b66;
    --msh-radius:         12px;
    --msh-radius-sm:      8px;
    --msh-font:           inherit;
    --msh-font-heading:   inherit;
    --msh-spacing:        32px;

    font-family: var(--msh-font);
    max-width: 920px;
    margin: 0 auto;
    color: var(--msh-text);
    line-height: 1.6;
}

.msh-shop *,
.msh-shop *::before,
.msh-shop *::after {
    box-sizing: border-box;
}

/* === Section === */
.msh-section {
    margin-bottom: var(--msh-spacing);
}

.msh-section-title {
    font-family: var(--msh-font-heading);
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--msh-text);
}

.msh-step {
    display: inline-flex;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e8eef7;
    color: var(--msh-accent);
    font-size: 14px;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* === Products grid === */
.msh-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.msh-product {
    background: var(--msh-bg);
    border: 1px solid var(--msh-border);
    border-radius: var(--msh-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color .15s, transform .15s;
}

.msh-product:hover { border-color: #b8b8b0; }

.msh-product--out { opacity: 0.65; }

.msh-product__cover {
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.msh-product__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.msh-product__placeholder {
    color: rgba(0, 0, 0, 0.45);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
}

.msh-product__body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.msh-product__title {
    font-family: var(--msh-font-heading);
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--msh-text);
}

.msh-product__desc {
    font-size: 13px;
    color: var(--msh-text-muted);
    margin: 0 0 12px;
    flex: 1;
}

.msh-product__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.msh-product__price {
    font-size: 16px;
    font-weight: 600;
}

/* === Badges === */
.msh-badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 500;
}
.msh-badge--ok    { background: #E1F5EE; color: #0F6E56; }
.msh-badge--low   { background: #FAEEDA; color: #854F0B; }
.msh-badge--out   { background: #FCEBEB; color: #A32D2D; }

/* === Quantity control === */
.msh-qty-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--msh-border);
    border-radius: 999px;
    padding: 4px;
    background: var(--msh-bg) !important;
    gap: 4px;
}

.msh-qty-control--disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Override חזק לכפתורים - מנצח כל ת'ים */
.msh-shop .msh-qty-btn,
.msh-shop .msh-qty-btn:focus,
.msh-shop .msh-qty-btn:active {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    border: 0 !important;
    background: var(--msh-surface) !important;
    background-image: none !important;
    background-color: var(--msh-surface) !important;
    font-size: 18px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    color: var(--msh-text) !important;
    font-weight: 400 !important;
    border-radius: 50% !important;
    transition: background-color .15s, color .15s, transform .1s !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    outline: none !important;
}

.msh-shop .msh-qty-btn:hover:not(:disabled) {
    background-color: var(--msh-accent) !important;
    color: #ffffff !important;
    transform: scale(1.08);
}

.msh-shop .msh-qty-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.msh-shop .msh-qty-btn:disabled {
    cursor: not-allowed !important;
    opacity: 0.4;
}

.msh-qty-input {
    flex: 1;
    text-align: center;
    border: 0;
    background: transparent;
    font-size: 15px;
    font-weight: 600;
    min-width: 30px;
    -moz-appearance: textfield;
    color: var(--msh-text);
}
.msh-qty-input::-webkit-outer-spin-button,
.msh-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* === Summary === */
.msh-summary {
    background: var(--msh-surface);
    border-radius: var(--msh-radius);
    padding: 18px 20px;
}

.msh-summary__empty {
    margin: 0;
    color: var(--msh-text-muted);
    text-align: center;
    font-size: 14px;
}

.msh-summary__lines:not(:empty) + .msh-summary__totals { margin-top: 12px; }

.msh-summary__line {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 6px 0;
    color: var(--msh-text-muted);
}

.msh-summary__totals {
    border-top: 1px solid #e0dfd8;
    padding-top: 10px;
}

.msh-summary__row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 4px 0;
    color: var(--msh-text-muted);
}

.msh-summary__row--total {
    font-size: 16px;
    font-weight: 600;
    color: var(--msh-text);
    border-top: 1px solid #e0dfd8;
    margin-top: 6px;
    padding-top: 10px;
}

/* === Form === */
.msh-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.msh-field {
    display: flex;
    flex-direction: column;
    font-size: 13px;
}

.msh-field--full { grid-column: 1 / -1; }

.msh-field > span {
    color: var(--msh-text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.msh-field input,
.msh-field textarea {
    border: 1px solid var(--msh-border);
    border-radius: var(--msh-radius-sm);
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    background: var(--msh-bg);
    color: var(--msh-text);
    transition: border-color .15s, box-shadow .15s;
}

.msh-field input:focus,
.msh-field textarea:focus {
    border-color: var(--msh-accent);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(24, 95, 165, 0.18);
}

.msh-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--msh-text-muted);
}

/* === Payment === */
.msh-payment-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

.msh-payment-option {
    cursor: pointer;
}
.msh-payment-option input { position: absolute; opacity: 0; pointer-events: none; }

.msh-payment-card {
    border: 1px solid var(--msh-border);
    border-radius: var(--msh-radius-sm);
    padding: 16px 12px;
    text-align: center;
    background: var(--msh-bg);
    transition: all .15s;
}

.msh-payment-option:hover .msh-payment-card {
    border-color: #b8b8b0;
}

.msh-payment-option input:checked + .msh-payment-card {
    border-color: var(--msh-accent);
    border-width: 2px;
    padding: 15px 11px;
    background: #f0f6fd;
}

.msh-payment-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.msh-payment-label {
    font-size: 13px;
    font-weight: 500;
}

.msh-payment-instructions {
    background: #f0f6fd;
    border-radius: var(--msh-radius-sm);
    padding: 12px 16px;
    font-size: 13px;
    color: var(--msh-accent);
}

.msh-instruction { display: none; }
.msh-instruction.is-active { display: block; }

/* === Errors === */
.msh-errors {
    background: #FCEBEB;
    border-right: 4px solid #A32D2D;
    border-radius: var(--msh-radius-sm);
    padding: 12px 16px;
    color: #A32D2D;
    font-size: 14px;
    margin-bottom: 16px;
}
.msh-errors ul { margin: 0; padding-right: 18px; }

/* === Submit === */
.msh-submit-wrap {
    text-align: center;
    margin-top: 24px;
}

.msh-submit-btn {
    width: 100%;
    max-width: 420px;
    background: var(--msh-primary);
    color: var(--msh-primary-text);
    border: 0;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--msh-radius-sm);
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    font-family: var(--msh-font-heading);
}

.msh-submit-btn:hover:not(:disabled) { opacity: 0.92; }
.msh-submit-btn:active:not(:disabled) { transform: scale(0.99); }
.msh-submit-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.msh-disclaimer {
    font-size: 12px;
    color: #8a8a85;
    margin: 10px 0 0;
}

/* === Thank you === */
.msh-thank-you {
    text-align: center;
    padding: 50px 20px;
    background: var(--msh-bg);
    border: 1px solid var(--msh-border);
    border-radius: var(--msh-radius);
}

.msh-thank-you__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: #E1F5EE;
    color: #0F6E56;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 600;
}

.msh-thank-you__title {
    font-family: var(--msh-font-heading);
    font-size: 22px;
    margin: 0 0 8px;
}

.msh-thank-you__order {
    color: var(--msh-text-muted);
    font-size: 15px;
    margin: 0 0 20px;
}

.msh-thank-you__instructions {
    background: #f0f6fd;
    color: var(--msh-accent);
    border-radius: var(--msh-radius-sm);
    padding: 14px 18px;
    font-size: 14px;
    margin: 16px auto;
    max-width: 520px;
    white-space: pre-line;
    text-align: right;
}

.msh-thank-you__email {
    font-size: 13px;
    color: var(--msh-text-muted);
    margin-top: 16px;
}

/* === Responsive === */
@media (max-width: 640px) {
    .msh-products-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .msh-product__cover { height: 80px; }
    .msh-product__title { font-size: 14px; }
    .msh-product__desc { font-size: 12px; }
    .msh-form-grid { grid-template-columns: 1fr; }
    .msh-payment-options { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
    .msh-products-grid { grid-template-columns: 1fr; }
}

/* === Customer Account === */
.msh-account { max-width: 720px; }
.msh-account__h2 { font-family: var(--msh-font-heading); font-size: 22px; font-weight: 600; margin: 0 0 4px; color: var(--msh-text); }
.msh-account__sub { font-size: 14px; color: var(--msh-text-muted); margin: 0; }
.msh-account__hero { background: var(--msh-surface); border-radius: var(--msh-radius); padding: 22px 24px; margin-bottom: 18px; }
.msh-account__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.msh-account__stat { background: var(--msh-bg); border: 1px solid var(--msh-border); border-radius: var(--msh-radius-sm); padding: 14px 16px; text-align: center; }
.msh-account__stat .v { font-size: 22px; font-weight: 600; }
.msh-account__stat .l { font-size: 11px; color: var(--msh-text-muted); margin-top: 2px; }
.msh-account__section { font-size: 14px; color: var(--msh-text-muted); margin: 20px 0 12px; font-weight: 500; }
.msh-account__order { background: var(--msh-bg); border: 1px solid var(--msh-border); border-radius: var(--msh-radius-sm); padding: 12px 16px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.msh-account__order-num { font-family: monospace; font-weight: 600; font-size: 14px; }
.msh-account__order-meta { color: var(--msh-text-muted); font-size: 12px; margin-top: 2px; }
.msh-account__badge { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.msh-account__badge--paid    { background: #E1F5EE; color: #0F6E56; }
.msh-account__badge--pending { background: #FAEEDA; color: #854F0B; }
.msh-account__badge--shipped { background: #E6F1FB; color: #185FA5; }
.msh-account__login { background: var(--msh-surface); border-radius: var(--msh-radius); padding: 30px; text-align: center; }
.msh-account__msg { font-size: 14px; color: var(--msh-text); margin: 14px 0; }
.msh-account__hint { font-size: 13px; color: var(--msh-text-muted); line-height: 1.7; margin-bottom: 18px; }
.msh-account__login-form { display: flex; gap: 10px; max-width: 380px; margin: 0 auto; }
.msh-account__login-form input { flex: 1; padding: 10px 12px; border-radius: var(--msh-radius-sm); border: 1px solid var(--msh-border); font-family: inherit; }
.msh-account__login-form button { padding: 10px 18px; width: auto; }

/* === Payment proof upload === */
.msh-payment-proof {
    margin-top: 14px;
    padding: 14px;
    background: var(--msh-surface);
    border-radius: var(--msh-radius-sm);
    border: 1px dashed var(--msh-border);
}
.msh-payment-proof label {
    display: block;
    font-size: 13px;
    color: var(--msh-text);
    margin-bottom: 8px;
    font-weight: 500;
}
.msh-payment-proof .hint {
    font-size: 12px;
    color: var(--msh-text-muted);
    margin-top: 6px;
}
.msh-payment-proof-input {
    font-size: 13px;
}
.msh-payment-proof-status {
    font-size: 13px;
    margin-top: 8px;
    display: none;
}
.msh-payment-proof-status:not(:empty) { display: block; }
