/* ============================================================
   shop.css — Product Detail, Cart, Checkout, Order Success
   ============================================================ */

.shop-section { padding: 40px 0 60px; background: #fafaf7; min-height: 70vh; }
.shop-section .container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Breadcrumb */
.shop-breadcrumb { font-size: 0.85rem; color: #9ca3af; margin-bottom: 24px; }
.shop-breadcrumb a { color: #2d7a4f; text-decoration: none; }
.shop-breadcrumb a:hover { text-decoration: underline; }
.shop-breadcrumb span { margin: 0 6px; }

/* ── Product Detail ── */
.pd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.pd-image-wrap {
    background: #f0faf4; border-radius: 16px; overflow: hidden;
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
}
.pd-image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.pd-image-placeholder { font-size: 6rem; }

.pd-info h1 { font-size: 1.7rem; font-weight: 700; color: #1a3c2e; margin-bottom: 8px; }
.pd-type-badge {
    display: inline-block; background: #d1fae5; color: #065f46;
    font-size: 0.78rem; font-weight: 600; padding: 3px 12px;
    border-radius: 20px; margin-bottom: 14px; text-transform: capitalize;
}
.pd-price-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.pd-price-current { font-size: 1.8rem; font-weight: 800; color: #2d7a4f; }
.pd-price-original { font-size: 1rem; color: #9ca3af; text-decoration: line-through; }
.pd-discount-badge {
    background: #fef3c7; color: #92400e; font-size: 0.78rem;
    font-weight: 700; padding: 3px 10px; border-radius: 20px;
}
.pd-stock { font-size: 0.85rem; margin-bottom: 16px; }
.pd-stock--in  { color: #16a34a; }
.pd-stock--low { color: #d97706; }
.pd-stock--out { color: #dc2626; }

.pd-desc { color: #4b5563; font-size: 0.95rem; line-height: 1.7; margin-bottom: 20px; }

.pd-qty-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.pd-qty-label { font-size: 0.88rem; color: #374151; font-weight: 600; }
.qty-control { display: flex; align-items: center; border: 1px solid #d1d5db; border-radius: 8px; overflow: hidden; }
.qty-control button {
    width: 36px; height: 36px; border: none; background: #f9fafb;
    font-size: 1.1rem; cursor: pointer; color: #374151;
}
.qty-control button:hover { background: #e5e7eb; }
.qty-control input {
    width: 50px; height: 36px; border: none; border-left: 1px solid #d1d5db;
    border-right: 1px solid #d1d5db; text-align: center; font-size: 0.95rem;
    outline: none;
}

.pd-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.btn-add-cart {
    flex: 1; background: #2d7a4f; color: #fff; border: none; border-radius: 10px;
    padding: 13px 24px; font-size: 1rem; font-weight: 600; cursor: pointer;
    transition: background .2s;
}
.btn-add-cart:hover { background: #245f3d; }
.btn-add-cart.in-cart { background: #16a34a; }
.btn-buy-now {
    flex: 1; background: #fff; color: #2d7a4f; border: 2px solid #2d7a4f;
    border-radius: 10px; padding: 13px 24px; font-size: 1rem; font-weight: 600;
    cursor: pointer; text-decoration: none; text-align: center; transition: all .2s;
}
.btn-buy-now:hover { background: #f0faf4; }

.pd-meta { border-top: 1px solid #e5e7eb; padding-top: 16px; }
.pd-meta-row { display: flex; gap: 8px; font-size: 0.85rem; margin-bottom: 6px; }
.pd-meta-label { color: #9ca3af; min-width: 100px; }
.pd-meta-value { color: #374151; font-weight: 500; }

.pd-tabs { margin-top: 40px; }
.pd-tab-nav { display: flex; gap: 0; border-bottom: 2px solid #e5e7eb; margin-bottom: 20px; }
.pd-tab-btn {
    padding: 10px 24px; border: none; background: none; font-size: 0.9rem;
    font-weight: 600; color: #6b7280; cursor: pointer; border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}
.pd-tab-btn.active { color: #2d7a4f; border-bottom-color: #2d7a4f; }
.pd-tab-panel { display: none; color: #4b5563; font-size: 0.92rem; line-height: 1.8; }
.pd-tab-panel.active { display: block; }

/* Cart icon badge in navbar */
.cart-nav-badge {
    display: inline-flex; align-items: center; justify-content: center;
    background: #ef4444; color: #fff; font-size: 0.65rem; font-weight: 700;
    width: 18px; height: 18px; border-radius: 50%; margin-left: 4px;
    vertical-align: middle;
}

/* ── Cart Page ── */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
.cart-page-title { font-size: 1.6rem; font-weight: 700; color: #1a3c2e; margin-bottom: 24px; }

.cart-items-wrap { background: #fff; border-radius: 14px; border: 1px solid #e5e7eb; overflow: hidden; }
.cart-item {
    display: grid; grid-template-columns: 80px 1fr auto auto;
    gap: 16px; align-items: center; padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
}
.cart-item:last-child { border-bottom: none; }
.cart-item-img {
    width: 80px; height: 80px; border-radius: 10px; object-fit: cover;
    background: #f0faf4; display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.cart-item-name { font-weight: 700; color: #1a3c2e; margin-bottom: 4px; }
.cart-item-type { font-size: 0.78rem; color: #6b7280; }
.cart-item-price { font-size: 0.9rem; color: #2d7a4f; font-weight: 600; margin-top: 4px; }

.cart-qty { display: flex; align-items: center; border: 1px solid #d1d5db; border-radius: 8px; overflow: hidden; }
.cart-qty button { width: 32px; height: 32px; border: none; background: #f9fafb; cursor: pointer; font-size: 1rem; }
.cart-qty button:hover { background: #e5e7eb; }
.cart-qty input { width: 40px; height: 32px; border: none; border-left: 1px solid #d1d5db; border-right: 1px solid #d1d5db; text-align: center; font-size: 0.9rem; outline: none; }

.cart-item-total { text-align: right; }
.cart-item-subtotal { font-weight: 700; color: #1a3c2e; font-size: 1rem; }
.cart-remove { background: none; border: none; color: #ef4444; font-size: 0.78rem; cursor: pointer; margin-top: 4px; }
.cart-remove:hover { text-decoration: underline; }

.cart-empty { padding: 60px 20px; text-align: center; }
.cart-empty-icon { font-size: 3.5rem; margin-bottom: 12px; }
.cart-empty h3 { color: #374151; margin-bottom: 6px; }
.cart-empty p { color: #9ca3af; margin-bottom: 20px; }

.cart-summary-card { background: #fff; border-radius: 14px; border: 1px solid #e5e7eb; padding: 24px; position: sticky; top: 90px; }
.cart-summary-title { font-size: 1.1rem; font-weight: 700; color: #1a3c2e; margin-bottom: 16px; }
.summary-row { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 10px; color: #374151; }
.summary-row.total { font-weight: 700; font-size: 1.05rem; color: #1a3c2e; border-top: 1px solid #e5e7eb; padding-top: 12px; margin-top: 4px; }
.summary-discount { color: #16a34a; }
.btn-checkout {
    display: block; width: 100%; background: #2d7a4f; color: #fff; border: none;
    border-radius: 10px; padding: 14px; font-size: 1rem; font-weight: 600;
    cursor: pointer; text-align: center; text-decoration: none; margin-top: 16px;
    transition: background .2s;
}
.btn-checkout:hover { background: #245f3d; }
.btn-continue { display: block; text-align: center; color: #2d7a4f; font-size: 0.88rem; margin-top: 10px; text-decoration: none; }
.btn-continue:hover { text-decoration: underline; }

/* ── Checkout Page ── */
.checkout-layout { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; }
.checkout-title { font-size: 1.6rem; font-weight: 700; color: #1a3c2e; margin-bottom: 24px; }

.checkout-card { background: #fff; border-radius: 14px; border: 1px solid #e5e7eb; padding: 24px; margin-bottom: 20px; }
.checkout-card-title { font-size: 1rem; font-weight: 700; color: #1a3c2e; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

/* Address cards */
.address-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.address-card {
    border: 2px solid #e5e7eb; border-radius: 10px; padding: 14px 16px;
    cursor: pointer; transition: border-color .2s; position: relative;
}
.address-card.selected { border-color: #2d7a4f; background: #f0faf4; }
.address-card input[type="radio"] { position: absolute; opacity: 0; }
.address-card-label { font-size: 0.72rem; font-weight: 700; background: #d1fae5; color: #065f46; padding: 2px 8px; border-radius: 10px; margin-bottom: 6px; display: inline-block; }
.address-card-name { font-weight: 600; color: #1a3c2e; font-size: 0.92rem; }
.address-card-phone { font-size: 0.82rem; color: #6b7280; margin-bottom: 4px; }
.address-card-addr { font-size: 0.85rem; color: #374151; }
.address-card-check { position: absolute; top: 14px; right: 14px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #d1d5db; display: flex; align-items: center; justify-content: center; }
.address-card.selected .address-card-check { background: #2d7a4f; border-color: #2d7a4f; color: #fff; font-size: 0.7rem; }

.btn-add-address {
    background: none; border: 2px dashed #d1d5db; border-radius: 10px;
    padding: 12px; width: 100%; color: #6b7280; font-size: 0.88rem;
    cursor: pointer; transition: all .2s;
}
.btn-add-address:hover { border-color: #2d7a4f; color: #2d7a4f; }

/* Address form modal */
.addr-modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5);
    z-index: 1000; align-items: center; justify-content: center;
}
.addr-modal-overlay.open { display: flex; }
.addr-modal {
    background: #fff; border-radius: 16px; padding: 28px; width: 100%;
    max-width: 500px; max-height: 90vh; overflow-y: auto;
}
.addr-modal-title { font-size: 1.1rem; font-weight: 700; color: #1a3c2e; margin-bottom: 20px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; color: #374151; margin-bottom: 5px; }
.form-group input, .form-group select {
    width: 100%; border: 1px solid #d1d5db; border-radius: 8px;
    padding: 9px 12px; font-size: 0.9rem; outline: none;
}
.form-group input:focus, .form-group select:focus { border-color: #2d7a4f; }
.addr-modal-actions { display: flex; gap: 10px; margin-top: 4px; }
.btn-save-addr {
    flex: 1; background: #2d7a4f; color: #fff; border: none; border-radius: 8px;
    padding: 11px; font-size: 0.92rem; font-weight: 600; cursor: pointer;
}
.btn-cancel-addr {
    flex: 1; background: #f3f4f6; color: #374151; border: none; border-radius: 8px;
    padding: 11px; font-size: 0.92rem; cursor: pointer;
}

/* Suggest address */
.suggest-row { display: flex; gap: 8px; margin-bottom: 14px; }
.suggest-input { flex: 1; border: 1px solid #d1d5db; border-radius: 8px; padding: 9px 12px; font-size: 0.9rem; outline: none; }
.suggest-input:focus { border-color: #2d7a4f; }
.btn-suggest { background: #2d7a4f; color: #fff; border: none; border-radius: 8px; padding: 9px 16px; font-size: 0.88rem; cursor: pointer; white-space: nowrap; }
.suggest-results { border: 1px solid #e5e7eb; border-radius: 8px; max-height: 180px; overflow-y: auto; display: none; }
.suggest-item { padding: 10px 14px; font-size: 0.85rem; cursor: pointer; border-bottom: 1px solid #f3f4f6; color: #374151; }
.suggest-item:hover { background: #f0faf4; color: #2d7a4f; }

/* Payment */
.payment-options { display: flex; flex-direction: column; gap: 10px; }
.payment-option {
    display: flex; align-items: center; gap: 12px; border: 2px solid #e5e7eb;
    border-radius: 10px; padding: 14px 16px; cursor: pointer; transition: border-color .2s;
}
.payment-option.selected { border-color: #2d7a4f; background: #f0faf4; }
.payment-option input[type="radio"] { width: 18px; height: 18px; accent-color: #2d7a4f; }
.payment-option-label { font-weight: 600; color: #1a3c2e; font-size: 0.92rem; }
.payment-option-desc { font-size: 0.78rem; color: #6b7280; }

/* Order summary sidebar */
.checkout-summary { background: #fff; border-radius: 14px; border: 1px solid #e5e7eb; padding: 24px; position: sticky; top: 90px; }
.checkout-summary-title { font-size: 1rem; font-weight: 700; color: #1a3c2e; margin-bottom: 16px; }
.checkout-item-row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.checkout-item-img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: #f0faf4; flex-shrink: 0; }
.checkout-item-name { font-size: 0.85rem; font-weight: 600; color: #1a3c2e; }
.checkout-item-qty { font-size: 0.78rem; color: #6b7280; }
.checkout-item-price { font-size: 0.88rem; font-weight: 700; color: #2d7a4f; margin-left: auto; }
.checkout-divider { border: none; border-top: 1px solid #e5e7eb; margin: 14px 0; }
.btn-place-order {
    display: block; width: 100%; background: #2d7a4f; color: #fff; border: none;
    border-radius: 10px; padding: 14px; font-size: 1rem; font-weight: 600;
    cursor: pointer; text-align: center; margin-top: 16px; transition: background .2s;
}
.btn-place-order:hover { background: #245f3d; }
.btn-place-order:disabled { background: #9ca3af; cursor: not-allowed; }

/* ── Order Success ── */
.success-section { padding: 60px 0; background: #fafaf7; min-height: 70vh; }
.success-section .container { max-width: 680px; margin: 0 auto; padding: 0 20px; text-align: center; }
.success-icon { font-size: 4rem; margin-bottom: 16px; }
.success-title { font-size: 1.8rem; font-weight: 700; color: #1a3c2e; margin-bottom: 8px; }
.success-subtitle { color: #6b7280; margin-bottom: 32px; }
.success-order-card { background: #fff; border-radius: 14px; border: 1px solid #e5e7eb; padding: 24px; text-align: left; margin-bottom: 24px; }
.success-order-num { font-size: 0.85rem; color: #6b7280; margin-bottom: 4px; }
.success-order-num strong { color: #2d7a4f; font-size: 1rem; }
.success-items { margin-top: 16px; border-top: 1px solid #f3f4f6; padding-top: 16px; }
.success-item { display: flex; justify-content: space-between; font-size: 0.88rem; padding: 6px 0; border-bottom: 1px solid #f9fafb; }
.success-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 1rem; margin-top: 12px; color: #1a3c2e; }
.success-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-track { background: #2d7a4f; color: #fff; border-radius: 10px; padding: 12px 28px; text-decoration: none; font-weight: 600; }
.btn-shop-more { background: #fff; color: #2d7a4f; border: 2px solid #2d7a4f; border-radius: 10px; padding: 12px 28px; text-decoration: none; font-weight: 600; }

/* Responsive */
@media (max-width: 768px) {
    .pd-grid, .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
    .cart-item { grid-template-columns: 60px 1fr; }
    .cart-item-total { grid-column: 2; }
    .form-row-2 { grid-template-columns: 1fr; }
}


/* ============================================================
   Products Listing Page
   ============================================================ */
.products-section { padding: 40px 0 60px; background: #fafaf7; min-height: 70vh; }
.products-section .container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.page-header { text-align: center; margin-bottom: 36px; }
.page-header h1 { font-size: 2rem; color: #1a3c2e; font-weight: 700; margin-bottom: 6px; }
.page-header p  { color: #6b7280; font-size: 1rem; }

.products-toolbar {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
    padding: 14px 18px; margin-bottom: 28px;
}
.toolbar-search { flex: 1; min-width: 200px; display: flex; gap: 8px; }
.toolbar-search input { flex: 1; border: 1px solid #d1d5db; border-radius: 8px; padding: 8px 14px; font-size: 0.9rem; outline: none; }
.toolbar-search input:focus { border-color: #2d7a4f; }
.toolbar-search button { background: #2d7a4f; color: #fff; border: none; border-radius: 8px; padding: 8px 18px; cursor: pointer; font-size: 0.9rem; }
.toolbar-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar-filters select { border: 1px solid #d1d5db; border-radius: 8px; padding: 8px 12px; font-size: 0.88rem; background: #fff; cursor: pointer; outline: none; }
.toolbar-filters select:focus { border-color: #2d7a4f; }
.toolbar-count { color: #6b7280; font-size: 0.88rem; margin-left: auto; white-space: nowrap; }

.type-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.type-pill { padding: 6px 18px; border-radius: 20px; border: 1px solid #d1d5db; background: #fff; color: #374151; font-size: 0.85rem; cursor: pointer; text-decoration: none; transition: all .2s; }
.type-pill:hover, .type-pill.active { background: #2d7a4f; color: #fff; border-color: #2d7a4f; }

.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }

.product-card { background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid #e5e7eb; transition: box-shadow .2s, transform .2s; display: flex; flex-direction: column; }
.product-card:hover { box-shadow: 0 8px 28px rgba(0,0,0,.10); transform: translateY(-3px); }

.product-image { position: relative; height: 200px; background: #f0faf4; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.product-card:hover .product-image img { transform: scale(1.04); }
.product-image .no-image { font-size: 4rem; }

.product-badge { position: absolute; top: 10px; right: 10px; background: #ef4444; color: #fff; font-size: 0.75rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.product-type-badge { position: absolute; top: 10px; left: 10px; background: rgba(45,122,79,.85); color: #fff; font-size: 0.72rem; font-weight: 600; padding: 3px 9px; border-radius: 20px; text-transform: capitalize; }

.product-info { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.product-info h3 { font-size: 1rem; font-weight: 700; color: #1a3c2e; margin: 0; line-height: 1.3; }
.product-benefits { font-size: 0.82rem; color: #6b7280; margin: 0; flex: 1; }

.product-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 8px; }
.product-price { display: flex; flex-direction: column; }
.price-original { font-size: 0.78rem; color: #9ca3af; text-decoration: line-through; }
.price-current  { font-size: 1.1rem; font-weight: 700; color: #2d7a4f; }

.product-actions { display: flex; gap: 6px; }
.btn-view   { background: #fff; border: 1px solid #2d7a4f; color: #2d7a4f; border-radius: 7px; padding: 6px 12px; font-size: 0.8rem; text-decoration: none; white-space: nowrap; }
.btn-cart   { background: #2d7a4f; color: #fff; border: none; border-radius: 7px; padding: 6px 12px; font-size: 0.8rem; cursor: pointer; white-space: nowrap; }
.btn-view:hover { background: #f0faf4; }
.btn-cart:hover { background: #245f3d; }

.product-card--oos { filter: grayscale(1); opacity: .75; }
.product-card--oos:hover { transform: none; box-shadow: none; }
.oos-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 0.9rem; letter-spacing: .5px; }
.btn-cart--oos { background: #9ca3af; cursor: not-allowed; opacity: .7; }
.btn-cart--oos:hover { background: #9ca3af; }

.empty-state { grid-column: 1/-1; text-align: center; padding: 60px 20px; color: #9ca3af; }
.empty-state .empty-icon { font-size: 3.5rem; margin-bottom: 12px; }
.empty-state h3 { color: #374151; margin-bottom: 6px; }

.pagination-wrapper { margin-top: 36px; display: flex; justify-content: center; }
.ap-pagination { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.ap-pagination-info { color: #6b7280; font-size: 0.9rem; text-align: center; }
.ap-pagination-list { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.ap-page-item { display: flex; }
.ap-page-link { display: flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 8px 12px; font-size: 0.9rem; font-weight: 500; color: #374151; background: #fff; border: 1px solid #d1d5db; border-radius: 8px; text-decoration: none; transition: all 0.2s; }
.ap-page-link:hover { background: #f9fafb; border-color: #2d7a4f; color: #2d7a4f; }
.ap-page-item.active .ap-page-link { background: #2d7a4f; border-color: #2d7a4f; color: #fff; }
.ap-page-item.disabled .ap-page-link { color: #9ca3af; background: #f9fafb; border-color: #e5e7eb; cursor: not-allowed; }
.ap-page-item.disabled .ap-page-link:hover { background: #f9fafb; border-color: #e5e7eb; color: #9ca3af; }
.ap-page-item:first-child .ap-page-link, .ap-page-item:last-child .ap-page-link { font-size: 1.1rem; }

@media (max-width: 640px) {
    .ap-pagination { gap: 12px; }
    .ap-pagination-info { font-size: 0.85rem; }
    .ap-page-link { min-width: 36px; height: 36px; padding: 6px 10px; font-size: 0.85rem; }
}
