/* ==========================================================================
   Halal Meat Order – Frontend Styles
   ========================================================================== */

/* ─── Reset / Base ─── */
.hmo-shop,
.hmo-cart,
.hmo-checkout,
.hmo-single-product,
.hmo-confirmation {
    max-width: 1200px;
    margin: 20px auto;
    padding: 15px;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: #333;
    box-sizing: border-box;
}

*, *::before, *::after { box-sizing: inherit; }

/* ─── Buttons ─── */
.hmo-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #6b1f1f;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    transition: background 0.2s ease, transform 0.1s ease;
    text-align: center;
}
.hmo-btn:hover,
.hmo-btn:focus {
    background: #4e1515;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}
.hmo-btn:active { transform: translateY(0); }

.hmo-btn-primary  { background: #c53030; }
.hmo-btn-primary:hover { background: #9b2c2c; }

.hmo-btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    width: 100%;
    display: block;
    margin-top: 12px;
}

.hmo-btn-whatsapp { background: #25d366; }
.hmo-btn-whatsapp:hover { background: #1da851; }

/* ─── Filters / Search bar ─── */
.hmo-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    align-items: center;
}
.hmo-filters input[type="search"],
.hmo-filters select {
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    flex: 1;
    min-width: 140px;
    background: #fff;
    color: #333;
}
.hmo-filters input[type="search"]:focus,
.hmo-filters select:focus {
    outline: none;
    border-color: #c53030;
    box-shadow: 0 0 0 2px rgba(197, 48, 48, 0.15);
}

/* ─── Product Grid ─── */
.hmo-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 22px;
}

.hmo-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 16px;
}

/* ─── Product Card ─── */
.hmo-product-card {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 16px;
    background: #fff;
    position: relative;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.hmo-product-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.10);
    transform: translateY(-2px);
}

.hmo-product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.hmo-product-card h3 {
    margin: 4px 0;
    font-size: 16px;
    line-height: 1.3;
}
.hmo-product-card h3 a {
    color: #222;
    text-decoration: none;
}
.hmo-product-card h3 a:hover { color: #c53030; }

.hmo-price {
    font-size: 18px;
    color: #c53030;
    font-weight: 700;
    margin: 4px 0 8px;
}

.hmo-no-img {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fdf5f5;
    border-radius: 8px;
    font-size: 64px;
}
.hmo-no-img--lg {
    height: 320px;
    font-size: 100px;
    border-radius: 10px;
}

/* ─── Badges ─── */
.hmo-halal-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #16a34a;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
    letter-spacing: 0.4px;
}
.hmo-halal-badge--inline {
    position: static;
    display: inline-block;
    margin-bottom: 8px;
}

.hmo-stock-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
    color: #fff;
}
.hmo-stock-badge.out { background: #dc2626; }
.hmo-stock-badge.pre { background: #d97706; }

/* ─── Pagination ─── */
.hmo-pagination {
    margin: 32px 0 16px;
    text-align: center;
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
}
.hmo-pagination a {
    padding: 8px 14px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    border-radius: 5px;
    font-size: 14px;
    transition: background 0.15s;
}
.hmo-pagination a:hover { background: #f0f0f0; }
.hmo-pagination a.active {
    background: #c53030;
    color: #fff;
    border-color: #c53030;
    pointer-events: none;
}

/* ─── Single Product ─── */
.hmo-single-product {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}
.hmo-sp-image img {
    width: 100%;
    border-radius: 10px;
    object-fit: cover;
}
.hmo-sp-info h1 {
    margin-top: 0;
    font-size: 26px;
    line-height: 1.2;
}
.hmo-sp-desc {
    margin: 12px 0 20px;
    line-height: 1.7;
    color: #555;
}
.hmo-out-stock {
    color: #dc2626;
    font-weight: 600;
    padding: 12px 16px;
    background: #fef2f2;
    border-radius: 6px;
    border-left: 4px solid #dc2626;
}

/* ─── Add-to-cart form ─── */
.hmo-add-form label {
    display: block;
    margin: 14px 0 5px;
    font-weight: 600;
    font-size: 14px;
}
.hmo-add-form input[type="number"],
.hmo-add-form input[type="text"],
.hmo-add-form select,
.hmo-add-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #333;
    transition: border-color 0.2s;
}
.hmo-add-form input:focus,
.hmo-add-form select:focus,
.hmo-add-form textarea:focus {
    outline: none;
    border-color: #c53030;
    box-shadow: 0 0 0 2px rgba(197, 48, 48, 0.12);
}
.hmo-add-form input[type="number"] { max-width: 100px; }
.hmo-sp-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.hmo-sp-buttons .hmo-btn { flex: 1; min-width: 140px; }
.hmo-add-msg {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
    min-height: 24px;
}
.hmo-add-msg.success { color: #16a34a; }
.hmo-add-msg.error   { color: #dc2626; }

/* ─── Cart Table ─── */
.hmo-cart h2 { margin-top: 0; }

.hmo-cart-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}
.hmo-cart-table th {
    background: #fdf5f5;
    padding: 12px 14px;
    text-align: left;
    font-weight: 700;
    color: #555;
    border-bottom: 2px solid #eee;
    white-space: nowrap;
}
.hmo-cart-table td {
    padding: 14px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}
.hmo-cart-table tr:last-child td { border-bottom: none; }

.hmo-qty-input {
    width: 70px;
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    text-align: center;
}
.hmo-remove-item {
    background: none;
    border: none;
    color: #c53030;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.15s;
}
.hmo-remove-item:hover { background: #fef2f2; }

.hmo-line-total { font-weight: 600; white-space: nowrap; }

.hmo-cart-totals {
    padding: 20px 24px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    text-align: right;
}
.hmo-cart-totals p { margin: 0 0 12px; font-size: 16px; }
.hmo-subtotal { font-weight: 700; color: #c53030; }

.hmo-cart-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.hmo-empty-cart {
    text-align: center;
    padding: 50px 20px;
    color: #888;
}
.hmo-empty-cart p { font-size: 18px; margin-bottom: 20px; }

/* ─── Checkout ─── */
.hmo-checkout h2 { margin-top: 0; }

.hmo-checkout-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 36px;
    align-items: start;
}

.hmo-checkout-fields h3,
.hmo-checkout-summary h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
    color: #222;
}
.hmo-checkout-fields h3:not(:first-child) { margin-top: 28px; }

.hmo-checkout-fields label {
    display: block;
    margin: 14px 0 5px;
    font-weight: 600;
    font-size: 14px;
}
.hmo-checkout-fields input,
.hmo-checkout-fields select,
.hmo-checkout-fields textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #333;
    transition: border-color 0.2s;
}
.hmo-checkout-fields input:focus,
.hmo-checkout-fields select:focus,
.hmo-checkout-fields textarea:focus {
    outline: none;
    border-color: #c53030;
    box-shadow: 0 0 0 2px rgba(197, 48, 48, 0.12);
}

/* Payment method radio */
.hmo-payment-methods {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}
.hmo-payment-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 2px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: border-color 0.15s, background 0.15s;
}
.hmo-payment-option:hover { border-color: #c53030; background: #fef9f9; }
.hmo-payment-option input[type="radio"] { accent-color: #c53030; width: 18px; height: 18px; }
.hmo-payment-option input[type="radio"]:checked + * { color: #c53030; }

.hmo-bank-details {
    background: #fef9e7;
    border: 1px solid #f6c042;
    border-radius: 6px;
    padding: 14px 18px;
    margin-top: 10px;
}
.hmo-bank-details pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 14px;
    color: #555;
}

/* Order summary sidebar */
.hmo-checkout-summary {
    background: #fafafa;
    border: 1px solid #eee;
    padding: 24px;
    border-radius: 10px;
    position: sticky;
    top: 20px;
}
.hmo-summary-items {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}
.hmo-summary-items li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}
.hmo-summary-items li:last-child { border-bottom: none; }
.hmo-summary-items li span { white-space: nowrap; font-weight: 600; }

.hmo-summary-totals {
    border-top: 2px solid #eee;
    padding-top: 14px;
    margin-top: 8px;
}
.hmo-summary-totals p {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    font-size: 14px;
}
.hmo-total {
    font-size: 18px !important;
    border-top: 2px solid #333;
    padding-top: 10px !important;
    margin-top: 6px !important;
    color: #c53030;
}

#hmo-checkout-msg {
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
    min-height: 20px;
    text-align: center;
}
#hmo-checkout-msg.error   { color: #dc2626; }
#hmo-checkout-msg.success { color: #16a34a; }

/* ─── Order Confirmation ─── */
.hmo-confirmation { max-width: 720px; }

.hmo-confirm-banner {
    text-align: center;
    padding: 36px 24px;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-radius: 12px;
    margin-bottom: 28px;
    border: 1px solid #bbf7d0;
}
.hmo-confirm-banner--error {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border-color: #fecaca;
}
.hmo-confirm-icon { font-size: 48px; display: block; margin-bottom: 10px; }
.hmo-confirm-banner h2 { margin: 0; font-size: 24px; color: #15803d; }
.hmo-confirm-banner--error h2 { color: #991b1b; }

.hmo-confirm-details {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 24px;
    line-height: 1.8;
}
.hmo-confirm-details p { margin: 4px 0; }

.hmo-confirm-note {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 12px 18px;
    border-radius: 4px;
    margin: 20px 0;
    font-size: 14px;
    color: #1e40af;
}

/* ─── Cart Icon (shortcode) ─── */
.hmo-cart-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 22px;
    text-decoration: none;
    color: inherit;
    padding: 4px 8px;
}
.hmo-cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: #c53030;
    color: #fff;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
    .hmo-checkout-grid {
        grid-template-columns: 1fr;
    }
    .hmo-checkout-summary {
        position: static;
    }
}
@media (max-width: 768px) {
    .hmo-single-product {
        grid-template-columns: 1fr;
    }
    .hmo-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 14px;
    }
    .hmo-cart-table {
        display: block;
        overflow-x: auto;
    }
    .hmo-cart-actions { justify-content: stretch; }
    .hmo-cart-actions .hmo-btn { flex: 1; }
}
@media (max-width: 480px) {
    .hmo-filters { flex-direction: column; }
    .hmo-filters input,
    .hmo-filters select { min-width: 100%; }
    .hmo-sp-buttons { flex-direction: column; }
    .hmo-sp-buttons .hmo-btn { min-width: 100%; }
}
