/* ==========================================================================
   NadPoint Homepage Engine — Frontend
   ========================================================================== */

.ndp-homepage { overflow-x: hidden; }

/* ---- Section shell ---- */
.ndp-section { padding: 40px 20px; }
.ndp-section:nth-child(even) { background: #fafafa; }
.ndp-section-inner { max-width: 1280px; margin: 0 auto; }
.ndp-section-placeholder { text-align: center; }
.ndp-section-empty { color: #999; padding: 30px 0; text-align: center; }

.ndp-section-heading { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.ndp-section-title { font-size: 1.6rem; font-weight: 700; color: #1b3022; margin: 0; }
.ndp-section-viewall { font-size: 0.85rem; color: #c59b27; text-decoration: none; font-weight: 600; }
.ndp-section-viewall:hover { text-decoration: underline; }

/* ---- Section controls: category tabs, search, explore ---- */
.ndp-section-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.ndp-category-tabs { display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; flex: 1; padding-bottom: 4px; }
.ndp-cat-tab { flex: 0 0 auto; padding: 7px 16px; border-radius: 20px; border: 1px solid #e0e0e0; background: #fff; color: #555; font-size: 0.82rem; cursor: pointer; white-space: nowrap; transition: all 0.2s; }
.ndp-cat-tab.active { background: #1b3022; color: #fff; border-color: #1b3022; }
.ndp-cat-tab:hover:not(.active) { border-color: #c59b27; color: #c59b27; }

.ndp-section-search { display: flex; align-items: center; gap: 8px; background: #f5f5f5; border-radius: 20px; padding: 7px 16px; flex: 0 0 200px; }
.ndp-section-search i { color: #999; font-size: 0.8rem; }
.ndp-section-search-input { border: none; background: none; outline: none; font-size: 0.85rem; width: 100%; }

.ndp-explore-toggle { flex: 0 0 auto; padding: 7px 16px; border-radius: 20px; border: 1px solid #c59b27; background: #fff; color: #c59b27; font-size: 0.82rem; cursor: pointer; }
.ndp-explore-toggle:hover { background: #c59b27; color: #fff; }
.ndp-explore-panel { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 0.85rem; }
.ndp-explore-panel select { padding: 7px 12px; border-radius: 8px; border: 1px solid #ddd; }

/* ---- Shared product card (Flash Sales, Trending, New Arrivals, Best Sellers, campaigns) ---- */
.ndp-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.ndp-product-card { display: block; text-decoration: none; color: #1b3022; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.05); transition: transform 0.25s, box-shadow 0.25s; }
.ndp-product-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0,0,0,0.1); }
.ndp-product-card-img { position: relative; aspect-ratio: 1/1; background: #f5f5f5; }
.ndp-product-card-img img { width: 100%; height: 100%; object-fit: cover; }
.ndp-product-card-img .no-image { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #ccc; font-size: 2rem; }
.ndp-flash-badge { position: absolute; top: 8px; left: 8px; background: #e63946; color: #fff; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; }
.ndp-product-card-body { padding: 12px 14px; }
.ndp-product-card-body h4 { font-size: 0.88rem; margin: 0 0 6px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ndp-product-card-price { font-weight: 700; color: #c59b27; font-size: 0.95rem; }
.ndp-product-card-price del { color: #999; font-weight: 400; font-size: 0.82rem; margin-left: 6px; }
.ndp-bogo-tag { display: inline-block; margin-top: 6px; background: #eafaf1; color: #1f8a4c; font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; }

/* ---- Hero Slider ---- */
.ndp-hero-slider { position: relative; border-radius: 16px; overflow: hidden; min-height: 360px; }
.ndp-hero-slide { display: none; min-height: 360px; background-size: cover; background-position: center; align-items: center; padding: 0 60px; background-color: #1b3022; }
.ndp-hero-slide.active { display: flex; }
.ndp-hero-slide-content { max-width: 480px; color: #fff; }
.ndp-hero-slide-content h2 { font-size: 2.2rem; margin: 0 0 10px; }
.ndp-hero-slide-content p { font-size: 1rem; opacity: 0.9; margin-bottom: 20px; }
.ndp-hero-cta { display: inline-block; background: #c59b27; color: #fff; padding: 12px 28px; border-radius: 10px; text-decoration: none; font-weight: 700; }
.ndp-hero-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.ndp-hero-dot { width: 9px; height: 9px; border-radius: 50%; border: none; background: rgba(255,255,255,0.5); cursor: pointer; }
.ndp-hero-dot.active { background: #fff; }

/* ---- Category Grid ---- */
.ndp-category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.ndp-category-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: #fff; border-radius: 12px; padding: 22px 10px; text-decoration: none; box-shadow: 0 2px 10px rgba(0,0,0,0.04); transition: transform 0.2s; }
.ndp-category-tile:hover { transform: translateY(-3px); }
.ndp-category-name { font-weight: 700; color: #1b3022; font-size: 0.9rem; }
.ndp-category-count { font-size: 0.75rem; color: #999; }

/* ---- Deal of the Day ---- */
.ndp-deal-of-day { display: flex; gap: 30px; background: linear-gradient(135deg, #1b3022, #2d5436); border-radius: 16px; padding: 30px; color: #fff; align-items: center; flex-wrap: wrap; }
.ndp-deal-image { flex: 0 0 220px; position: relative; }
.ndp-deal-image img { width: 100%; border-radius: 12px; aspect-ratio: 1/1; object-fit: cover; }
.ndp-deal-countdown { position: absolute; bottom: 8px; left: 8px; background: rgba(0,0,0,0.6); padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.ndp-deal-info { flex: 1; min-width: 220px; }
.ndp-deal-info h3 { font-size: 1.5rem; margin: 0 0 10px; }
.ndp-deal-price { font-size: 1.6rem; font-weight: 700; color: #ffd166; margin-bottom: 8px; }
.ndp-deal-price del { color: rgba(255,255,255,0.6); font-size: 1rem; margin-left: 8px; }
.ndp-deal-stock { font-size: 0.85rem; opacity: 0.85; margin-bottom: 14px; }

/* ---- Bundle Engine ---- */
.ndp-bundle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.ndp-bundle-card { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 2px 12px rgba(0,0,0,0.05); }
.ndp-bundle-pair { display: flex; align-items: center; gap: 10px; }
.ndp-bundle-item { flex: 1; text-align: center; text-decoration: none; color: #1b3022; font-size: 0.78rem; }
.ndp-bundle-item img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px; margin-bottom: 6px; }
.ndp-bundle-plus { font-size: 1.3rem; color: #c59b27; font-weight: 700; }
.ndp-bundle-total { text-align: center; margin-top: 12px; font-weight: 700; color: #c59b27; }

/* ---- New Vendors ---- */
.ndp-vendor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.ndp-vendor-card { display: flex; flex-direction: column; align-items: center; gap: 6px; background: #fff; border-radius: 12px; padding: 20px 10px; text-decoration: none; box-shadow: 0 2px 10px rgba(0,0,0,0.04); position: relative; }
.ndp-vendor-logo { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.ndp-vendor-card h4 { margin: 0; font-size: 0.85rem; color: #1b3022; text-align: center; }
.ndp-vendor-badge { background: #eafaf1; color: #1f8a4c; font-size: 0.65rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.ndp-vendor-count { font-size: 0.72rem; color: #999; }

/* ---- Local Sellers ---- */
.ndp-locate-prompt { text-align: center; padding: 30px 20px; background: #fafafa; border-radius: 12px; margin-bottom: 18px; }
.ndp-enable-location-btn { background: linear-gradient(135deg, #1b3022, #2d5436); color: #fff; border: none; padding: 12px 26px; border-radius: 30px; font-weight: 700; cursor: pointer; font-size: 0.9rem; }
.ndp-enable-location-btn:hover { filter: brightness(1.1); }
.ndp-enable-location-btn:disabled { opacity: 0.7; cursor: wait; }
.ndp-vendor-distance { font-size: 0.74rem; color: #1f8a4c; font-weight: 600; }

/* ---- Customer Photo Reviews (shoppable UGC grid) ---- */
.ndp-ugc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.ndp-ugc-card { position: relative; display: block; text-decoration: none; color: #1b3022; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.06); transition: transform 0.25s; }
.ndp-ugc-card:hover { transform: translateY(-4px); }
.ndp-ugc-photo { position: relative; aspect-ratio: 4/5; background: #f0f0f0; }
.ndp-ugc-photo img { width: 100%; height: 100%; object-fit: cover; }
.ndp-ugc-rating { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,0.6); color: #ffd166; font-size: 0.7rem; padding: 3px 8px; border-radius: 20px; letter-spacing: 1px; }
.ndp-ugc-info { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.ndp-ugc-product { font-size: 0.82rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ndp-ugc-price { font-size: 0.8rem; color: #c59b27; font-weight: 700; }
.ndp-ugc-customer { font-size: 0.72rem; color: #999; }
.ndp-ugc-shop-tag { position: absolute; top: 8px; right: 8px; background: #c59b27; color: #fff; font-size: 0.65rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; text-transform: uppercase; }

/* ---- Campaigns (Day/Month Offers, BOGO, BOGO2) ---- */
.ndp-campaign-grid { display: flex; flex-direction: column; gap: 24px; }
.ndp-campaign-block { background: #fff; border-radius: 14px; padding: 18px 20px; box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.ndp-campaign-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.ndp-campaign-header h4 { margin: 0; color: #1b3022; }
.ndp-campaign-discount { background: #fdecea; color: #e63946; font-weight: 700; font-size: 0.8rem; padding: 4px 12px; border-radius: 20px; }

/* ---- Coupon Hub ---- */
.ndp-coupon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.ndp-coupon-card { background: #fff; border: 2px dashed #c59b27; border-radius: 12px; padding: 18px; text-align: center; }
.ndp-coupon-discount { font-size: 1.6rem; font-weight: 800; color: #c59b27; }
.ndp-coupon-vendor { display: block; font-size: 0.75rem; color: #999; margin: 6px 0 4px; }
.ndp-coupon-code { display: block; background: #f5f5f5; border-radius: 6px; padding: 6px; font-weight: 700; letter-spacing: 1px; margin-bottom: 8px; }
.ndp-coupon-expiry { display: block; font-size: 0.72rem; color: #e67e22; margin-bottom: 10px; }
.ndp-coupon-copy { background: #1b3022; color: #fff; border: none; padding: 7px 18px; border-radius: 8px; cursor: pointer; font-size: 0.78rem; }
.ndp-coupon-copy:hover { background: #c59b27; }

/* ==========================================================================
   ANIMATION ENGINE — assigned per section/element/trigger from the admin
   panel. IntersectionObserver applies the "armed" class once visible
   (covers both entry and scroll-triggered); hover/click are plain CSS
   transitions and listeners; exit is applied just before an AJAX swap.
   ========================================================================== */
[data-ndp-anim] { opacity: 0; }
[data-ndp-anim].ndp-anim-none, [data-ndp-anim].ndp-anim-armed.ndp-anim-none { opacity: 1; }

@keyframes ndpFadeIn      { from { opacity: 0; } to { opacity: 1; } }
@keyframes ndpFadeInUp    { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ndpFadeInDown  { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ndpSlideInLeft { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes ndpSlideInRight{ from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes ndpZoomIn      { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }
@keyframes ndpBounceIn    { 0% { opacity: 0; transform: scale(0.7); } 60% { opacity: 1; transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes ndpPulse       { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes ndpShake       { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes ndpFlipIn      { from { opacity: 0; transform: rotateY(90deg); } to { opacity: 1; transform: rotateY(0); } }
@keyframes ndpRipple      { 0% { box-shadow: 0 0 0 0 rgba(197,155,39,0.5); } 100% { box-shadow: 0 0 0 14px rgba(197,155,39,0); } }

.ndp-anim-armed.ndp-anim-fadeIn       { animation-name: ndpFadeIn; opacity: 1; }
.ndp-anim-armed.ndp-anim-fadeInUp     { animation-name: ndpFadeInUp; opacity: 1; }
.ndp-anim-armed.ndp-anim-fadeInDown   { animation-name: ndpFadeInDown; opacity: 1; }
.ndp-anim-armed.ndp-anim-slideInLeft  { animation-name: ndpSlideInLeft; opacity: 1; }
.ndp-anim-armed.ndp-anim-slideInRight { animation-name: ndpSlideInRight; opacity: 1; }
.ndp-anim-armed.ndp-anim-zoomIn       { animation-name: ndpZoomIn; opacity: 1; }
.ndp-anim-armed.ndp-anim-bounceIn     { animation-name: ndpBounceIn; opacity: 1; }
.ndp-anim-armed.ndp-anim-flipIn       { animation-name: ndpFlipIn; opacity: 1; }
.ndp-anim-armed[class*="ndp-anim-"]   { animation-fill-mode: both; animation-timing-function: ease; }

.ndp-anim-hover-pulse:hover  { animation: ndpPulse 0.5s; }
.ndp-anim-hover-shake:hover  { animation: ndpShake 0.4s; }
.ndp-anim-hover-lift:hover   { transform: translateY(-5px); transition: transform 0.25s; }
.ndp-anim-hover-glow:hover   { box-shadow: 0 0 18px rgba(197,155,39,0.45); transition: box-shadow 0.25s; }
.ndp-anim-hover-tilt:hover   { transform: rotate(-1.5deg); transition: transform 0.25s; }
.ndp-anim-click-ripple:active { animation: ndpRipple 0.5s; }
.ndp-anim-click-pulse:active  { animation: ndpPulse 0.25s; }

.ndp-anim-exiting { animation: ndpFadeIn 0.25s reverse forwards; }

@media (max-width: 768px) {
    .ndp-section { padding: 28px 16px; }
    .ndp-section-title { font-size: 1.3rem; }
    .ndp-hero-slide { padding: 0 24px; min-height: 280px; }
    .ndp-hero-slide-content h2 { font-size: 1.5rem; }
    .ndp-deal-of-day { flex-direction: column; }
    .ndp-section-search { flex: 1 1 100%; order: 3; }
}
