* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: #1f2430;
    line-height: 1.5;
    background: #fff; /* overrides admin.css's gray page background, also loaded on these pages */
}

a { text-decoration: none; color: inherit; }

.site-header {
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.site-header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-logo {
    font-weight: 700;
    font-size: 18px;
}

.site-logo-img {
    max-height: 36px;
    display: block;
}

.site-nav {
    display: flex;
    gap: 20px;
    font-size: 14px;
}

.site-header-actions {
    display: flex;
    gap: 18px;
    font-size: 14px;
}

.hero-placeholder {
    max-width: 1180px;
    margin: 60px auto;
    padding: 0 20px;
    text-align: center;
}

.hero-placeholder h1 {
    font-size: 28px;
    margin-bottom: 12px;
}

.hero-placeholder p {
    color: #6b7280;
    font-size: 15px;
}

.site-footer {
    border-top: 1px solid #e5e7eb;
    margin-top: 60px;
    padding: 24px 20px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
}

.site-nav a { font-size: 14px; color: #374151; }

.site-search input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13.5px;
    width: 220px;
}

/* ===== Product grid & cards ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card {
    position: relative;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.15s ease;
}

.product-card-link {
    display: block;
}

.product-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.08); }

.product-card-image {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #f9fafb;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-image-placeholder {
    width: 100%;
    height: 100%;
    background: #f3f4f6;
}

.product-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
}

.product-card-badge-gray {
    background: #6b7280;
    left: auto;
    right: 8px;
}

.product-card-body { padding: 12px 14px; }

.product-card-name {
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-price {
    font-size: 14px;
    font-weight: 700;
}

.product-card-price-old {
    text-decoration: line-through;
    color: #9ca3af;
    font-weight: 400;
    font-size: 12.5px;
    margin-right: 6px;
}

.product-card-price-sale { color: #dc2626; }

.product-card-wishlist {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.9);
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.product-card-wishlist.active {
    color: #dc2626;
}

.product-card-quick-add {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 9px;
    background: #111827;
    color: #fff;
    border: none;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.product-card:hover .product-card-quick-add {
    opacity: 1;
    transform: translateY(0);
}

.btn-wishlist {
    width: 48px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font-size: 18px;
    cursor: pointer;
}

.btn-wishlist.active { color: #dc2626; border-color: #dc2626; }

#store-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #111827;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13.5px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 999;
}

#store-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== Cart page ===== */
.cart-page {
    max-width: 1000px;
    margin: 40px auto 70px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    align-items: start;
}

.cart-item {
    display: grid;
    grid-template-columns: 70px 1fr auto auto;
    gap: 16px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
}

.cart-item img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.cart-item-name {
    font-size: 14px;
    font-weight: 500;
}

.cart-item-variant {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.cart-item-price {
    font-size: 13.5px;
    color: #6b7280;
    margin-top: 4px;
}

.cart-item-qty {
    width: 60px;
    padding: 7px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    text-align: center;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #dc2626;
    font-size: 12.5px;
    cursor: pointer;
}

.cart-item-line-total {
    font-weight: 600;
    font-size: 14px;
    min-width: 80px;
    text-align: right;
}

.cart-summary {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    position: sticky;
    top: 20px;
}

.cart-summary h3 { font-size: 15px; margin-bottom: 14px; }

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13.5px;
    margin-bottom: 10px;
    color: #4b5563;
}

.cart-summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 700;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}

.cart-checkout-btn {
    width: 100%;
    margin-top: 18px;
    padding: 12px;
    background: #111827;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    display: block;
    text-decoration: none;
}

.cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

/* ===== Account area ===== */
.account-layout {
    max-width: 1080px;
    margin: 40px auto 70px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 30px;
    align-items: start;
}

.account-sidebar {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 0;
}

.account-sidebar-name {
    font-weight: 600;
    font-size: 14px;
    padding: 0 18px 14px;
    border-bottom: 1px solid #f0f1f3;
    margin-bottom: 6px;
}

.account-sidebar nav a {
    display: block;
    padding: 9px 18px;
    font-size: 13.5px;
    color: #374151;
}

.account-sidebar nav a.active,
.account-sidebar nav a:hover {
    background: #f9fafb;
    color: #111827;
    font-weight: 600;
}

.account-content { min-width: 0; }

.address-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

@media (max-width: 640px) {
    .account-layout { grid-template-columns: 1fr; }
}

/* ===== Checkout ===== */
.checkout-page {
    max-width: 1080px;
    margin: 40px auto 70px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    align-items: start;
}

.checkout-line-item {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 8px;
}

.order-confirmed-banner {
    text-align: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 36px 20px;
    margin-bottom: 20px;
}

.order-confirmed-check {
    width: 56px;
    height: 56px;
    line-height: 56px;
    border-radius: 50%;
    background: #dcfce7;
    color: #16a34a;
    font-size: 28px;
    margin: 0 auto 16px;
}

.order-confirmed-banner h1 {
    font-size: 22px;
    margin-bottom: 8px;
}

.order-confirmed-banner p {
    color: #6b7280;
    font-size: 13.5px;
}

@media (max-width: 640px) {
    .checkout-page { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .cart-page { grid-template-columns: 1fr; }
    .cart-item { grid-template-columns: 60px 1fr; }
    .cart-item-line-total { grid-column: 2; text-align: left; }
}

/* ===== Shop layout (filters + grid) ===== */
.shop-layout {
    max-width: 1180px;
    margin: 30px auto 60px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 30px;
    align-items: start;
}

.shop-filters {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px;
}

.shop-filters h3 { font-size: 15px; margin-bottom: 14px; }

.shop-filters label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    margin: 12px 0 5px;
    color: #374151;
}

.shop-filters select,
.shop-filters input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
}

.shop-price-inputs {
    display: flex;
    gap: 8px;
}

.shop-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-weight: 500 !important;
}

.shop-checkbox-label input { width: auto; }

.shop-btn-apply {
    width: 100%;
    margin-top: 16px;
    padding: 9px;
    background: #111827;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13.5px;
    cursor: pointer;
}

.shop-clear-link {
    display: block;
    text-align: center;
    margin-top: 10px;
    font-size: 12.5px;
    color: #6b7280;
}

.shop-results-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 13.5px;
    color: #6b7280;
}

.shop-sort-form select {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
}

.shop-empty {
    color: #6b7280;
    padding: 40px 0;
    text-align: center;
}

.shop-pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 30px;
}

.shop-pagination a {
    padding: 7px 13px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
}

.shop-pagination a.active {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

/* ===== Category banner ===== */
.category-banner {
    max-width: 1180px;
    margin: 40px auto 10px;
    padding: 0 20px;
    text-align: center;
}

.category-banner h1 { font-size: 24px; margin-bottom: 6px; }
.category-banner p { color: #6b7280; font-size: 14px; }

.category-banner-image {
    max-height: 220px;
    width: 100%;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 20px;
}

/* ===== Product detail page ===== */
.product-detail {
    max-width: 1180px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.product-gallery-main img {
    width: 100%;
    border-radius: 12px;
    aspect-ratio: 1/1;
    object-fit: cover;
    background: #f9fafb;
}

.product-gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.product-gallery-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    cursor: pointer;
}

.product-breadcrumb {
    font-size: 12.5px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.product-title {
    font-size: 26px;
    margin: 8px 0 4px;
}

.product-brand {
    font-size: 13.5px;
    color: #6b7280;
    margin-bottom: 14px;
}

.product-price {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 14px;
}

.product-price-old {
    text-decoration: line-through;
    color: #9ca3af;
    font-weight: 400;
    font-size: 16px;
    margin-right: 8px;
}

.product-price-sale { color: #dc2626; }

.product-short-desc {
    color: #4b5563;
    font-size: 14.5px;
    margin-bottom: 14px;
}

.product-sku {
    font-size: 12.5px;
    color: #9ca3af;
    margin-bottom: 8px;
}

.product-stock { margin-bottom: 20px; font-size: 13.5px; }
.product-stock-in { color: #16a34a; font-weight: 600; }
.product-stock-out { color: #dc2626; font-weight: 600; }
.product-stock-back { color: #d97706; font-weight: 600; }

.product-variant-selectors { margin-bottom: 20px; }

.product-variant-group { margin-bottom: 14px; }

.product-variant-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7280;
}

.product-variant-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.variant-option-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font-size: 13.5px;
    cursor: pointer;
}

.variant-option-btn.active {
    border-color: #111827;
    background: #111827;
    color: #fff;
}

.product-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.product-qty-input {
    width: 70px;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    text-align: center;
}

.btn-add-to-cart {
    flex: 1;
    padding: 12px 20px;
    background: #111827;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
}

.btn-add-to-cart:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.product-full-description {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.product-full-description h3 {
    font-size: 15px;
    margin-bottom: 10px;
}

.product-full-description p {
    color: #4b5563;
    font-size: 14px;
    line-height: 1.7;
}

.related-products {
    max-width: 1180px;
    margin: 0 auto 60px;
    padding: 0 20px;
}

.related-products h2 {
    font-size: 18px;
    margin-bottom: 18px;
}

.store-note {
    color: #9ca3af;
    font-size: 12.5px;
}

/* ===== Auth pages (login/register/forgot/reset) ===== */
.auth-page {
    max-width: 440px;
    margin: 50px auto 80px;
    padding: 0 20px;
}

.auth-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 36px;
}

.auth-card h1 {
    font-size: 22px;
    margin-bottom: 6px;
}

.auth-intro {
    color: #6b7280;
    font-size: 13.5px;
    margin-bottom: 20px;
}

.auth-card label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin: 14px 0 6px;
    color: #374151;
}

.auth-card input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}

.auth-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.auth-btn-primary {
    width: 100%;
    margin-top: 22px;
    padding: 11px;
    background: #111827;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
}

.auth-forgot-link {
    text-align: right;
    margin-top: 8px;
    font-size: 12.5px;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 13.5px;
    color: #6b7280;
}

.auth-alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.auth-alert-success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.auth-dev-note {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    word-break: break-all;
    margin-bottom: 16px;
}

@media (max-width: 640px) {
    .site-header-inner { flex-wrap: wrap; }
    .site-nav { order: 3; width: 100%; overflow-x: auto; }
    .site-search input { width: 100%; }
    .shop-layout { grid-template-columns: 1fr; }
    .product-detail { grid-template-columns: 1fr; gap: 24px; }
}
