/* =====================================================================
   STORE PAGES: products, cart, checkout, my orders, about
   Loaded after style.css (uses its colours and buttons)
===================================================================== */

/* ---------- Page header + layout helpers ---------- */
.products-wrap { width: min(1200px, 100% - 40px); margin: 0 auto; padding: 32px 0 0; }

.page-hero {
    background: linear-gradient(#fff, var(--bg));
    border-bottom: 1px solid var(--line);
    padding: 40px 0 30px;
}
.page-hero .wrap { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.page-hero h1, .page-title { font-family: var(--serif); font-size: clamp(2rem, 4vw, 2.9rem); color: var(--g-900); letter-spacing: -.01em; line-height: 1.1; }
.page-hero p { color: var(--muted); margin-top: 8px; font-size: 1.02rem; }
.page-title { margin: 0 0 20px; }

/* legacy button names still used in a few pages */
.btn-add, a.btn-add {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; padding: 0 20px; border: 0; border-radius: 12px;
    background: var(--g-600); color: #fff; text-decoration: none;
    font: 700 .95rem var(--font); cursor: pointer;
    box-shadow: 0 6px 16px rgba(18,130,79,.26);
    transition: background .15s, transform .15s;
}
.btn-add:hover { background: var(--g-700); transform: translateY(-1px); color: #fff; }
.btn-add:disabled { background: #b7c2bb; box-shadow: none; cursor: not-allowed; transform: none; }
.btn-checkout { background: var(--g-900); box-shadow: none; }
.btn-checkout:hover { background: var(--g-800); }
.btn-clear {
    height: 44px; padding: 0 18px; border-radius: 12px; cursor: pointer;
    background: #fff; border: 1.5px solid #f1c9c9; color: var(--red); font: 700 .92rem var(--font);
}
.btn-clear:hover { background: var(--red-50); }

/* ---------- Products ---------- */
.shop-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 28px 0 24px; }
.cat-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-filter a {
    padding: 8px 18px; border-radius: 999px; border: 1.5px solid var(--line);
    background: #fff; color: var(--ink-2); font-weight: 700; font-size: .9rem; text-decoration: none;
    transition: all .15s;
}
.cat-filter a:hover { border-color: var(--g-500); color: var(--g-700); }
.cat-filter a.on { background: var(--g-600); border-color: var(--g-600); color: #fff; }

.shop-search { position: relative; width: min(320px, 100%); }
.shop-search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.shop-search input {
    width: 100%; height: 46px; padding: 0 16px 0 44px; border-radius: 999px;
    border: 1.5px solid var(--line); background: #fff; font: 500 .93rem var(--font);
}
.shop-search input:focus { outline: none; border-color: var(--g-500); box-shadow: 0 0 0 4px rgba(22,160,95,.15); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 22px; }
.product-card {
    display: flex; flex-direction: column; overflow: hidden;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--g-200); }
.product-media {
    position: relative; aspect-ratio: 4 / 3; padding: 22px;
    display: grid; place-items: center;
    background: radial-gradient(circle at 50% 40%, #fff, var(--g-50));
}
.product-media img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .25s; }
.product-card:hover .product-media img { transform: scale(1.05); }
.no-img { font-size: 3.4rem; }
.product-tag { position: absolute; top: 14px; left: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.stock-flag { position: absolute; top: 14px; right: 14px; }

.product-info { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px 20px; flex: 1; }
.product-info h2 { font-size: 1.08rem; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.product-desc {
    color: var(--muted); font-size: .88rem; line-height: 1.5; min-height: 2.6em;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.price { font-size: 1.3rem; font-weight: 800; color: var(--g-800); margin-top: 6px; }
.product-buy { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 12px; }
.product-buy .btn-add { flex: 1; height: 42px; padding: 0 14px; }
.stock-info { font-weight: 700; color: var(--g-700); font-size: .92rem; padding-top: 12px; margin-top: auto; }
.added-msg { color: var(--g-700); font-weight: 700; font-size: .85rem; display: flex; align-items: center; gap: 6px; }
.empty-products { margin: 70px 0 30px; text-align: center; font-size: 1.1rem; color: var(--muted); font-weight: 600; }
.empty-products a { color: var(--g-700); font-weight: 700; }

.qty {
    display: inline-flex; align-items: center; gap: 2px; padding: 3px;
    background: var(--g-50); border: 1.5px solid var(--line); border-radius: 12px;
}
.qty-btn {
    width: 32px; height: 34px; border: 0; border-radius: 9px; background: transparent;
    color: var(--g-800); font: 700 1.1rem/1 var(--font); cursor: pointer;
    display: grid; place-items: center; padding: 0;
}
.qty-btn:hover { background: #fff; box-shadow: var(--shadow-sm); }
.qty-val { min-width: 26px; text-align: center; font-weight: 800; font-size: .95rem; }

/* ---------- Cart ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 370px; gap: 28px; align-items: start; margin-top: 30px; }
.cart-list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 6px 26px; }
.cart-item {
    display: grid; grid-template-columns: 84px 1fr auto 110px 36px; gap: 18px; align-items: center;
    padding: 20px 0; border-bottom: 1px solid var(--line-2);
}
.cart-item:last-child { border-bottom: 0; }
.cart-img { width: 84px; height: 72px; border-radius: 14px; background: var(--g-50); display: grid; place-items: center; font-size: 2rem; }
.cart-img img { max-width: 80%; max-height: 80%; object-fit: contain; }
.cart-name b { display: block; font-size: 1rem; }
.cart-name small { color: var(--muted); font-weight: 600; }
.cart-qty { display: flex; gap: 8px; align-items: center; }
.cart-qty input {
    width: 70px; height: 40px; border: 1.5px solid var(--line); border-radius: 10px;
    padding: 0 10px; text-align: center; font: 700 .95rem var(--font);
}
.cart-qty input:focus { outline: none; border-color: var(--g-500); }
.cart-qty button {
    height: 40px; padding: 0 14px; border: 0; border-radius: 10px; cursor: pointer;
    background: var(--g-100); color: var(--g-800); font: 700 .85rem var(--font);
}
.cart-qty button:hover { background: var(--g-200); }
.cart-sub { text-align: right; font-weight: 800; font-size: 1.02rem; }
.cart-remove {
    width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
    background: var(--red-50); color: var(--red); display: grid; place-items: center;
}
.cart-remove:hover { background: var(--red); color: #fff; }
.cart-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 0 14px; }

.sum-card, .of-summary {
    position: sticky; top: 98px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 26px; box-shadow: var(--shadow-sm);
}
.sum-card h3, .of-summary h3 { font-size: 1.1rem; margin-bottom: 16px; }
.sum-row, .of-row { display: flex; justify-content: space-between; gap: 12px; margin: 12px 0; color: var(--ink-2); font-weight: 600; }
.sum-total, .of-total { border-top: 1px dashed var(--line); padding-top: 16px; margin-top: 16px; color: var(--ink); font-size: 1.2rem; font-weight: 800; }
.sum-total span:last-child, .of-total span:last-child { color: var(--g-700); }
.sum-card .fbtn { margin-top: 18px; width: 100%; height: 52px; }
.sum-note { margin-top: 14px; display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .82rem; font-weight: 600; }

/* legacy cart table (kept for old markup) */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: left; font-size: .76rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--g-50); }
.cart-table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); font-size: .93rem; }
.cart-table tr:last-child td { border-bottom: 0; }

/* ---------- Checkout + customer-service order form ---------- */
.of-banner {
    display: flex; gap: 20px; align-items: center;
    width: min(1200px, 100% - 40px); margin: 32px auto 0;
    padding: 26px 30px; border-radius: 24px;
    background: linear-gradient(135deg, var(--g-50), var(--g-100)); border: 1px solid var(--g-200);
}
.of-icon { width: 64px; height: 64px; border-radius: 20px; background: #fff; box-shadow: var(--shadow-sm); display: grid; place-items: center; font-size: 1.9rem; flex-shrink: 0; }
.of-banner h1 { font-family: var(--serif); color: var(--g-900); font-size: 1.9rem; line-height: 1.1; }
.of-banner p { color: var(--g-800); font-size: .95rem; margin-top: 4px; font-weight: 500; }

.of-wrap {
    width: min(1200px, 100% - 40px); margin: 28px auto 0;
    display: grid; grid-template-columns: 1fr 370px; gap: 28px; align-items: start;
}
.of-card {
    position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 26px 28px 28px 92px; margin-bottom: 18px;
}
.of-num {
    position: absolute; left: 26px; top: 26px; width: 42px; height: 42px; border-radius: 50%;
    background: var(--g-600); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem;
}
.of-card h2 { font-size: 1.12rem; margin: 8px 0 18px; }
.of-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.of-full { grid-column: 1 / -1; }
.of-card label { display: block; font-weight: 700; font-size: .82rem; color: var(--ink-2); }
.of-card label .req { color: var(--red); }
.of-card input[type=text], .of-card input[type=tel], .of-card input[type=search] {
    display: block; width: 100%; height: 48px; margin-top: 6px; padding: 0 14px;
    border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
    font: 500 .95rem var(--font);
}
.of-card input:focus { outline: none; border-color: var(--g-500); box-shadow: 0 0 0 4px rgba(22,160,95,.15); }
.of-hint { margin-top: 14px; font-size: .85rem; color: var(--muted); }

.of-two { display: grid; grid-template-columns: 1fr 290px; gap: 20px; align-items: start; }
.of-map { position: relative; }
.of-map iframe { width: 100%; height: 190px; border: 1px solid var(--line); border-radius: 14px; display: block; }
.of-map button {
    position: absolute; right: 8px; bottom: 8px; padding: 7px 12px; cursor: pointer;
    background: #fff; border: 1.5px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-sm);
    font: 700 .76rem var(--font); color: var(--g-800);
}
.of-map button:hover { border-color: var(--g-500); }

.of-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
.of-filter input[type=search] { width: 220px; margin: 0; height: 40px; }
.of-chip {
    border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 15px;
    font: 700 .85rem var(--font); cursor: pointer; color: var(--ink-2);
}
.of-chip:hover { border-color: var(--g-500); }
.of-chip.on { background: var(--g-600); border-color: var(--g-600); color: #fff; }

.of-items { width: 100%; border-collapse: collapse; }
.of-items th { text-align: left; font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; background: var(--g-50); }
.of-items th:first-child { border-radius: 10px 0 0 10px; } .of-items th:last-child { border-radius: 0 10px 10px 0; }
.of-items td { padding: 12px; border-bottom: 1px solid var(--line-2); font-weight: 600; font-size: .92rem; vertical-align: middle; }
.of-items tr:last-child td { border-bottom: 0; }
.of-name img { width: 40px; height: 34px; object-fit: contain; vertical-align: middle; margin-right: 10px; }
.of-name small { color: var(--muted); font-weight: 600; }
.of-step { display: inline-flex; align-items: center; gap: 6px; }
.of-step button {
    width: 30px; height: 30px; border: 1.5px solid var(--line); border-radius: 50%; background: #fff;
    cursor: pointer; font-weight: 800; line-height: 1; padding: 0; color: var(--g-800);
}
.of-step button:hover { border-color: var(--g-500); background: var(--g-50); }
.of-step input { width: 56px; height: 34px; text-align: center; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; font: 700 .92rem var(--font); }
.of-link { color: var(--g-700); font-weight: 700; text-decoration: none; }
.of-link:hover { text-decoration: underline; }

.of-confirm {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 52px; margin: 20px 0 0; border: 0; border-radius: 14px; cursor: pointer;
    background: var(--g-600); color: #fff; font: 700 1rem var(--font);
    box-shadow: 0 8px 20px rgba(18,130,79,.28); transition: background .15s, transform .15s;
}
.of-confirm:hover { background: var(--g-700); transform: translateY(-1px); }
.of-select { height: 38px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 10px; font: 600 .9rem var(--font); background: #fff; }

/* ---------- My orders ---------- */
.order-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.order-box[open] { box-shadow: var(--shadow-sm); border-color: var(--g-200); }
.order-box summary {
    list-style: none; cursor: pointer; padding: 18px 22px;
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px 24px; font-weight: 600;
}
.order-box summary::-webkit-details-marker { display: none; }
.order-box summary::after { content: '▾'; color: var(--muted); margin-left: 4px; transition: transform .2s; }
.order-box[open] summary::after { transform: rotate(180deg); }
.order-box summary > b:nth-last-child(2) { margin-left: auto; }
.order-box > :not(summary) { margin-left: 22px; margin-right: 22px; }
.order-box > .cart-table { width: calc(100% - 44px); margin-top: 0; }
.order-box > p:last-child { margin-bottom: 20px; }
.order-box .product-desc { display: block; min-height: 0; margin-top: 12px; }

/* ---------- About ---------- */
.about-page { width: min(920px, 100% - 40px); margin: 0 auto; padding: 56px 0 0; }
.about-page h1 { font-family: var(--serif); font-size: clamp(2.1rem, 4.4vw, 3.2rem); color: var(--g-900); letter-spacing: -.01em; line-height: 1.1; margin-bottom: 22px; }
.about-page p { font-size: 1.1rem; line-height: 1.75; color: var(--ink-2); margin-bottom: 22px; }
.about-values { width: min(1200px, 100% - 40px); margin: 40px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.value { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; }
.value .ic { width: 52px; height: 52px; border-radius: 16px; background: var(--g-100); color: var(--g-700); display: grid; place-items: center; margin-bottom: 16px; }
.value h3 { margin-bottom: 6px; }
.value p { color: var(--muted); font-size: .95rem; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .cart-layout, .of-wrap { grid-template-columns: 1fr; }
    .sum-card, .of-summary { position: static; }
    .about-values { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .cart-item { grid-template-columns: 72px 1fr 36px; row-gap: 12px; }
    .cart-img { width: 72px; height: 64px; grid-row: span 2; }
    .cart-qty, .cart-sub { grid-column: 2; text-align: left; }
    .cart-remove { grid-column: 3; grid-row: 1; }
    .of-two, .of-grid { grid-template-columns: 1fr; }
    .of-card { padding: 78px 20px 22px; }
    .of-num { left: 20px; top: 20px; }
    .of-card h2 { position: absolute; left: 78px; top: 24px; margin: 0; }
    .of-banner { padding: 20px; }
    .shop-search { width: 100%; }
}
