/* shop.css — styling for the public storefront */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1a1a1a;
    background: #fff;
}

a { color: inherit; }

/* --- Header ------------------------------------------------------------------- */

.shop-header {
    border-bottom: 1px solid #e5e7eb;
    padding: 14px 0;
}

.shop-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.shop-logo {
    font-weight: 700;
    font-size: 1.2rem;
    text-decoration: none;
    color: #1a1a1a;
    flex-shrink: 0;
}

.shop-search {
    flex-grow: 1;
    display: flex;
    max-width: 420px;
}

.shop-search input {
    flex-grow: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px 0 0 6px;
    border-right: none;
}

.shop-search button {
    padding: 8px 14px;
    border: 1px solid #2563eb;
    background: #2563eb;
    color: #fff;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
}

.shop-header-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-left: auto;
    font-size: 0.9rem;
}

.shop-header-actions a { text-decoration: none; }

.cart-icon-link { position: relative; }
.cart-badge {
    background: #dc2626;
    color: #fff;
    border-radius: 999px;
    padding: 1px 6px;
    font-size: 0.7rem;
    margin-left: 4px;
}

/* --- Main / layout ------------------------------------------------------------------ */

.shop-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px;
    min-height: 60vh;
}

.shop-footer {
    text-align: center;
    padding: 24px;
    color: #9ca3af;
    font-size: 0.85rem;
}

/* --- Flash messages ----------------------------------------------------------------- */

.shop-flashes { margin-bottom: 20px; }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 8px; font-size: 0.9rem; }
.flash-success { background: #d1fae5; color: #065f46; }
.flash-danger  { background: #fee2e2; color: #991b1b; }
.flash-info    { background: #dbeafe; color: #1e40af; }

/* --- Hero ------------------------------------------------------------------------------ */

.hero { text-align: center; padding: 40px 0; }
.hero h1 { font-size: 2rem; margin-bottom: 8px; }
.hero p { color: #6b7280; }

/* --- Category grid --------------------------------------------------------------------- */

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin: 20px 0 40px;
}

.category-card {
    text-decoration: none;
    color: #1a1a1a;
    text-align: center;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
}

.category-card img, .category-card-placeholder {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    background: #f3f4f6;
    margin-bottom: 8px;
}

/* --- Product grid & cards ---------------------------------------------------------------- */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.product-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px;
}

.product-card a { text-decoration: none; color: inherit; }

.product-card img, .product-card-placeholder {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 6px;
    background: #f3f4f6;
    margin-bottom: 10px;
}

.product-card h3 { font-size: 0.95rem; margin: 0 0 6px; }

.product-card-price { font-weight: 600; margin-bottom: 10px; }
.product-card-price .unit { font-weight: 400; color: #6b7280; font-size: 0.8rem; }

.discount-badge {
    background: #fee2e2;
    color: #991b1b;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.7rem;
    margin-left: 6px;
}

/* --- Product list layout ------------------------------------------------------------------- */

.product-list-layout { display: grid; grid-template-columns: 200px 1fr; gap: 30px; }

.category-sidebar ul { list-style: none; padding: 0; margin: 10px 0 0; }
.category-sidebar li { margin-bottom: 6px; }
.category-sidebar a { text-decoration: none; color: #374151; font-size: 0.9rem; }
.category-sidebar a.active { font-weight: 700; color: #2563eb; }

/* --- Product detail ------------------------------------------------------------------------- */

.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 40px; }

.product-detail-image img, .product-detail-placeholder {
    width: 100%;
    border-radius: 10px;
    background: #f3f4f6;
    height: 320px;
    object-fit: cover;
}

.category-breadcrumb { font-size: 0.8rem; color: #6b7280; text-decoration: none; }

.product-detail-price { font-size: 1.4rem; font-weight: 700; margin: 10px 0; }
.product-detail-price .unit { font-weight: 400; color: #6b7280; font-size: 0.9rem; }
.compare-price { text-decoration: line-through; color: #9ca3af; margin-left: 10px; font-size: 1rem; }

.product-description { color: #4b5563; line-height: 1.5; }

.stock-note { color: #059669; font-size: 0.9rem; }
.stock-note.out-of-stock { color: #dc2626; }

.add-to-cart-form { display: flex; align-items: flex-end; gap: 10px; }
.add-to-cart-form input[type="number"] { width: 70px; padding: 8px; border: 1px solid #d1d5db; border-radius: 6px; }

/* --- Buttons -------------------------------------------------------------------------------- */

.btn {
    display: inline-block;
    padding: 9px 16px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #1a1a1a;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.9rem;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn-full { width: 100%; text-align: center; }
.btn-small { padding: 6px 10px; font-size: 0.8rem; }

.link-danger { background: none; border: none; color: #dc2626; cursor: pointer; text-decoration: underline; padding: 0; }

/* --- Cart / checkout tables ------------------------------------------------------------------- */

.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.cart-table th, .cart-table td { text-align: left; padding: 12px; border-bottom: 1px solid #e5e7eb; }
.cart-table th { font-size: 0.8rem; text-transform: uppercase; color: #6b7280; }

.cart-item-name { display: flex; align-items: center; gap: 10px; }
.cart-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }

.quantity-form { display: flex; gap: 6px; align-items: center; }
.quantity-form input { width: 60px; padding: 6px; border: 1px solid #d1d5db; border-radius: 6px; }

.cart-summary { max-width: 360px; margin-left: auto; border: 1px solid #e5e7eb; border-radius: 8px; padding: 20px; }
.cart-summary-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 1.1rem; margin-bottom: 10px; }
.cart-summary-note { color: #6b7280; font-size: 0.8rem; margin-bottom: 16px; }

/* --- Checkout ------------------------------------------------------------------------------------ */

.checkout-layout { display: grid; grid-template-columns: 1fr 340px; gap: 40px; }

.form-row { margin-bottom: 14px; display: flex; flex-direction: column; }
.form-row label { font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.form-row input, .form-row textarea, .form-row select {
    padding: 9px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
}

.form-row-group { display: flex; gap: 12px; }
.form-row-group .form-row { flex: 1; }

.checkout-hint { color: #6b7280; font-size: 0.8rem; }

.checkout-summary { border: 1px solid #e5e7eb; border-radius: 8px; padding: 20px; align-self: start; }
.checkout-items { list-style: none; padding: 0; margin: 0 0 14px; }
.checkout-items li { display: flex; justify-content: space-between; font-size: 0.9rem; padding: 6px 0; }

/* --- Badges -------------------------------------------------------------------------------------- */

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; text-transform: capitalize; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-confirmed { background: #dbeafe; color: #1e40af; }
.badge-preparing { background: #ede9fe; color: #5b21b6; }
.badge-out_for_delivery { background: #cffafe; color: #155e75; }
.badge-delivered { background: #d1fae5; color: #065f46; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }

/* --- Order detail -------------------------------------------------------------------------------- */

.page-header { display: flex; justify-content: space-between; align-items: center; }
.order-placed-date { color: #6b7280; font-size: 0.85rem; margin-top: -10px; }

.order-detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; align-items: start; margin-top: 20px; }

.order-totals { max-width: 320px; margin-top: 16px; }
.order-totals div { display: flex; justify-content: space-between; padding: 6px 0; }
.order-total-final { font-weight: 700; border-top: 1px solid #e5e7eb; margin-top: 6px; padding-top: 10px !important; }

.order-detail-sidebar h2 { font-size: 1rem; margin-top: 24px; margin-bottom: 8px; }
.order-detail-sidebar h2:first-child { margin-top: 0; }

/* --- Pagination ------------------------------------------------------------------------------------- */

.pagination { display: flex; gap: 16px; align-items: center; margin-top: 20px; }
.pagination a { text-decoration: none; color: #2563eb; }


.error-page {
    font-family: sans-serif;
    text-align: center;
    padding: 80px 20px;
}

body {
    margin: 0;
    padding: 0;
    background: #f4f6f8;
    font-family: Arial, Helvetica, sans-serif;
    color: #1a1a1a;
}
.outer-wrapper {
    background: #f4f6f8;
    padding: 30px 0;
}
.email-container {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    width: 600px;
}
.header {
    background: #2563eb;
    padding: 24px 30px;
}
.header span {
    color: #ffffff;
    font-size: 20px;
    font-weight: bold;
}
.body-cell {
    padding: 30px;
}
.headline {
    font-size: 20px;
    margin: 0 0 8px;
}
.intro {
    color: #4b5563;
    margin: 0 0 20px;
}
.summary {
    margin: 0 0 20px;
}
.items-table {
    border-collapse: collapse;
    margin-bottom: 20px;
    width: 100%;
}
.table-header-row {
    background: #f9fafb;
}
.table-header-cell {
    padding: 8px 10px;
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    border-bottom: 1px solid #e5e7eb;
}
.table-cell {
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
}
.totals-table {
    margin-bottom: 24px;
    width: 100%;
}
.totals-label,
.totals-value {
    padding: 4px 0;
    color: #4b5563;
}
.total-label,
.total-value {
    padding: 10px 0 0;
    font-weight: bold;
    border-top: 1px solid #e5e7eb;
}
.delivery-heading {
    font-size: 15px;
    margin: 0 0 8px;
}
.delivery-address {
    color: #4b5563;
    margin: 0 0 20px;
    line-height: 1.5;
}
.note {
    color: #6b7280;
    font-size: 13px;
}
.footer {
    background: #f9fafb;
    padding: 16px 30px;
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
}