/* === PERRY'S MART - SHOP APPLICATION STYLES === */

/* Global Typography */
body { font-family: 'Inter', sans-serif; }
h1, h2, h3, .font-playfair { font-family: 'Playfair Display', serif; }

/* --- PRODUCT GRID & CARDS --- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 30px; padding: 40px 0; }
.product-card { cursor: pointer; background-color: #ffffff !important; border: 1px solid #e2e8f0 !important; border-radius: 12px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.2s ease; text-decoration: none !important; color: inherit !important; }
.product-card:hover { transform: translateY(-8px); border-color: #cbd5e1 !important; box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); }
.product-image-container { width: 100%; height: 280px; background-color: #f8f9fa; position: relative; overflow: hidden; }
.product-image { width: 100%; height: 100%; object-fit: contain; display: block; }
.product-content { padding: 25px; flex-grow: 1; display: flex; flex-direction: column; }
.product-title { margin: 0 0 10px 0; font-size: 1.4rem; font-weight: 600; }
.product-price { font-size: 1.8rem; font-weight: 700; color: #007bff; margin: 0 0 15px 0; }
.product-price .gst-label { font-size: 0.9rem; font-weight: 400; color: #6c757d; }
.product-description { margin: 0 0 25px 0; flex-grow: 1; }
.product-button { display: inline-block; background-color: #007bff; color: #ffffff; padding: 12px 25px; border-radius: 8px; text-decoration: none; text-align: center; font-weight: 600; transition: background-color 0.3s ease; cursor: pointer; border: none; }
.product-button:hover { background-color: #0056b3; }
.no-products { grid-column: 1 / -1; }
.placeholder-image { width: 100%; height: 100%; background-color: #e9ecef; display: flex; align-items: center; justify-content: center; color: #868e96; font-size: 1rem; font-weight: 500; }

/* --- PRODUCT RIBBONS --- */
.product-card.product-sold .product-image-container::after { content: "SOLD"; position: absolute; bottom: 25px; right: -70px; width: 250px; text-align: center; background-color: rgba(220, 53, 69, 0.9); color: white; padding: 7px 0; font-size: 0.9rem; font-weight: bold; transform: rotate(-45deg); z-index: 20; box-shadow: 0 -2px 4px rgba(0,0,0,0.2); }
.product-card.product-sold .product-image { opacity: 0.6; }
.product-card.product-consigned .product-image-container::before { content: "CONSIGNED"; position: absolute; top: 25px; left: -70px; width: 250px; text-align: center; background-color: rgba(40, 167, 69, 0.95); color: white; padding: 7px 7px 7px 0px; font-size: 0.9rem; font-weight: bold; transform: rotate(-45deg); z-index: 15; box-shadow: 0 2px 4px rgba(0,0,0,0.2); text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.sold-text-indicator { display: none; }

/* --- CORE MODAL STYLES --- */
#imageModal.modal, #inquiryModal.modal, .modal { display: none; position: fixed !important; inset: 0 !important; width: 100% !important; height: 100% !important; background-color: rgba(0, 0, 0, 0.85) !important; z-index: 99999 !important; align-items: center !important; justify-content: center !important; padding: 12px 10px !important; box-sizing: border-box !important; overflow-y: auto !important; -webkit-overflow-scrolling: touch !important; animation: fadeInModal 0.3s; }
.modal[style*="display: block"], .modal[style*="display: flex"] { display: flex !important; }
@keyframes fadeInModal { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

#imageModal .modal-card { position: relative !important; max-width: 1200px !important; width: 94% !important; max-height: 92vh !important; max-height: 92dvh !important; display: flex !important; flex-direction: column !important; background: #ffffff !important; border-radius: 16px !important; overflow: hidden !important; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35) !important; margin: auto !important; animation: slideUp 0.3s ease-out; }
@media (min-width: 768px) {
    #imageModal .modal-card { flex-direction: row !important; height: 680px !important; max-height: 88vh !important; }
    #imageModal .modal-media-col { width: 58% !important; height: 100% !important; display: flex !important; flex-direction: column !important; background: #fbfbfb !important; border-right: 1px solid #edf2f7 !important; }
    #imageModal .modal-text-content { width: 42% !important; height: 100% !important; }
    #imageModal .modal-image-wrapper { padding: 24px !important; }
}
@media (min-width: 1280px) { #imageModal .modal-card { height: 720px !important; max-width: 1240px !important; } }
#imageModal .modal-media-col { width: 100%; display: flex; flex-direction: column; background: #ffffff; }

.close-button { position: absolute !important; top: 15px !important; right: 15px !important; font-size: 28px !important; font-weight: bold !important; color: #1e293b !important; background: rgba(255, 255, 255, 0.92) !important; border-radius: 50% !important; width: 40px !important; height: 40px !important; display: flex !important; align-items: center !important; justify-content: center !important; cursor: pointer !important; z-index: 1001 !important; line-height: 1 !important; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important; transition: background 0.2s, color 0.2s !important; }
.close-button:hover { background: #ffffff !important; color: #000000 !important; text-decoration: none; }

#imageModal .modal-image-wrapper { position: relative !important; width: 100% !important; flex: 1 1 auto !important; height: 320px; background-color: #ffffff !important; display: flex !important; align-items: center !important; justify-content: center !important; overflow: hidden !important; border-bottom: 1px solid #f1f5f9 !important; touch-action: pan-y pinch-zoom !important; }
#imageModal .modal-image-wrapper img { width: 100%; height: 100%; object-fit: contain; background-color: #ffffff; user-select: none; -webkit-user-drag: none; transition: opacity 0.15s ease-in-out; cursor: zoom-in; }

/* --- LIGHTBOX GALLERY ZOOM --- */
.zoom-hint-badge { position: absolute; top: 10px; left: 10px; background: rgba(0, 0, 0, 0.65); color: #ffffff; padding: 3px 8px; border-radius: 6px; font-size: 0.72rem; font-weight: 600; pointer-events: none; z-index: 15; display: flex; align-items: center; gap: 4px; }
#zoomOverlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.95); z-index: 100005; align-items: center; justify-content: center; padding: 15px; touch-action: pan-y pinch-zoom; }
#zoomOverlay img { max-width: 92vw; max-height: 92vh; max-height: 92dvh; object-fit: contain; border-radius: 4px; box-shadow: 0 0 25px rgba(0, 0, 0, 0.8); user-select: none; -webkit-user-drag: none; transition: opacity 0.15s ease-in-out; }
#zoomOverlay .zoom-close { position: absolute; top: 16px; right: 20px; color: #ffffff; font-size: 36px; font-weight: bold; cursor: pointer; line-height: 1; z-index: 100010; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); transition: transform 0.15s ease; }
#zoomOverlay .zoom-close:hover { transform: scale(1.15); }
.zoom-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, 0.18); color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.3); width: 50px; height: 50px; border-radius: 50%; cursor: pointer; font-size: 24px; display: flex; align-items: center; justify-content: center; transition: background 0.2s ease, transform 0.2s ease; z-index: 100010; user-select: none; }
.zoom-nav-btn:hover { background: rgba(255, 255, 255, 0.4); transform: translateY(-50%) scale(1.08); }
.zoom-nav-btn.zoom-prev-btn { left: 20px; }
.zoom-nav-btn.zoom-next-btn { right: 20px; }
.zoom-counter-badge { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, 0.7); color: #ffffff; padding: 4px 12px; border-radius: 12px; font-size: 0.85rem; font-weight: 600; pointer-events: none; z-index: 100010; letter-spacing: 0.5px; }

.modal-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0, 0, 0, 0.65); color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.2); width: 42px; height: 42px; border-radius: 50%; cursor: pointer; font-size: 20px; display: flex; align-items: center; justify-content: center; transition: background 0.2s ease, transform 0.2s ease; z-index: 45; user-select: none; -webkit-tap-highlight-color: transparent; }
.modal-nav-btn:hover { background: rgba(0, 0, 0, 0.9); transform: translateY(-50%) scale(1.08); }
.modal-nav-btn.prev-btn { left: 12px; }
.modal-nav-btn.next-btn { right: 12px; }
.image-counter-badge { position: absolute; bottom: 10px; right: 10px; background: rgba(0, 0, 0, 0.65); color: #ffffff; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; font-weight: 600; pointer-events: none; z-index: 10; }

#imageModal .modal-thumbnails { flex-shrink: 0 !important; min-height: 72px !important; display: flex !important; flex-wrap: wrap !important; align-items: center !important; gap: 10px !important; padding: 10px 18px !important; background: #f8fafc !important; border-top: 1px solid #edf2f7 !important; overflow-x: auto !important; scrollbar-width: none !important; -ms-overflow-style: none !important; }
#imageModal .modal-thumbnails::-webkit-scrollbar { display: none !important; }
.thumb-btn { flex: 0 0 54px !important; height: 54px !important; border-radius: 8px !important; overflow: hidden; border: 2px solid #e2e8f0 !important; cursor: pointer; padding: 0; background: #ffffff; transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; }
.thumb-btn:hover { transform: scale(1.05); border-color: #94a3b8 !important; }
.thumb-btn.is-active { border-color: #2563eb !important; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25) !important; }
.thumb-btn img { width: 100%; height: 100%; object-fit: cover; }

.share-icon-btn { position: absolute !important; top: 10px !important; right: 10px !important; background: rgba(255, 255, 255, 0.9) !important; border: 1px solid #e2e8f0 !important; border-radius: 50% !important; width: 34px !important; height: 34px !important; display: flex !important; align-items: center !important; justify-content: center !important; cursor: pointer !important; z-index: 25 !important; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important; transition: background 0.2s, transform 0.2s !important; }
.share-icon-btn:hover { background: #ffffff !important; transform: scale(1.08) !important; }
.share-toast { display: none; position: absolute; top: 40px; right: 0; background: #1e293b; color: #ffffff; font-size: 0.75rem; font-weight: 600; padding: 4px 8px; border-radius: 6px; white-space: nowrap; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); pointer-events: none; }
.share-toast.show { display: block; }

#imageModal .modal-text-content { width: 100%; display: flex !important; flex-direction: column !important; height: 100% !important; min-height: 0 !important; background: #ffffff !important; }
#imageModal .modal-scroll-area { flex: 1 1 auto !important; min-height: 0 !important; overflow-y: auto !important; -webkit-overflow-scrolling: touch !important; padding: 18px 20px 14px 20px !important; }
#imageModal .modal-title { font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 700; color: #212529; margin-top: 0; margin-bottom: 15px; text-align: left; }
#imageModal .modal-description { font-size: 1rem; line-height: 1.6; color: #495057; white-space: pre-wrap; text-align: left; width: 100%; }
#imageModal .modal-action-footer { flex-shrink: 0 !important; padding: 12px 20px 16px 20px !important; background: #ffffff !important; border-top: 1px solid #e2e8f0 !important; box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.04) !important; }

/* --- INQUIRY MODAL STYLES --- */
.inquiry-modal-content { position: relative !important; max-width: 550px !important; width: 90% !important; margin: auto !important; background: #ffffff !important; border-radius: 12px !important; padding: 30px 40px !important; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25) !important; animation: slideUp 0.3s ease-out; }
.inquiry-modal-content h3 { margin-top: 0; margin-bottom: 25px; font-size: 1.8rem; border-bottom: 1px solid #e5e7eb; padding-bottom: 15px; }
.inquiry-modal-content .form-group { margin-bottom: 20px; }
.inquiry-modal-content .form-group label { display: block; margin-bottom: 0.5rem; font-size: 0.875rem; font-weight: 500; color: #374151; }
.inquiry-modal-content .form-group input[type="text"], .inquiry-modal-content .form-group input[type="email"], .inquiry-modal-content .form-group input[type="tel"], .inquiry-modal-content .form-group textarea { display: block; width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #d1d5db; border-radius: 0.375rem; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out; }
.inquiry-modal-content .form-group input::placeholder, .inquiry-modal-content .form-group textarea::placeholder { color: #9ca3af; }
.inquiry-modal-content .form-group input:focus, .inquiry-modal-content .form-group textarea:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25); }
.inquiry-modal-content .form-group textarea { min-height: 120px; }
.inquiry-modal-content .honeypot { display: none; }
.inquiry-modal-content .inquiry-product-name { font-size: 1rem; font-weight: 600; color: #4a5568; background-color: #f7fafc; padding: 12px; border-radius: 8px; margin-bottom: 20px; }
.inquiry-modal-content .modal-message { padding: 15px; border-radius: 8px; margin-bottom: 15px; font-weight: 500; }
.inquiry-modal-content .modal-message.success { background-color: #d4edda; color: #155724; }
.inquiry-modal-content .modal-message.error { background-color: #f8d7da; color: #721c24; }

/* --- CART STYLES --- */
.modal-qty-select { height: 46px; padding: 0 12px; border: 1px solid #cbd5e1; border-radius: 8px; background-color: #ffffff; font-size: 0.95rem; font-weight: 600; color: #1e293b; outline: none; cursor: pointer; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.modal-qty-select:focus { border-color: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15); }
#cartOverlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 999998; }
#cartDrawer { position: fixed; top: 0; right: -100%; width: 100%; max-width: 420px; height: 100%; background: #ffffff; z-index: 999999; box-shadow: -4px 0 25px rgba(0,0,0,0.15); transition: right 0.3s ease-in-out; display: flex; flex-direction: column; }
#cartDrawer.open { right: 0; }

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 767px) {
    #imageModal .modal-card { max-width: 100% !important; width: 100% !important; height: 94vh !important; height: 94dvh !important; max-height: 94vh !important; border-radius: 16px 16px 0 0 !important; display: flex !important; flex-direction: column !important; overflow: hidden !important; margin-top: auto !important; }
    #imageModal .modal-text-content { display: block !important; overflow-y: auto !important; -webkit-overflow-scrolling: touch !important; flex: 1 1 auto !important; height: auto !important; padding: 0 !important; }
    #imageModal .modal-scroll-area { padding: 16px 18px 20px 18px !important; overflow-y: visible !important; height: auto !important; }
    #imageModal .modal-image-wrapper { height: 38vh !important; min-height: 240px !important; max-height: 320px !important; padding: 8px !important; background-color: #f8fafc !important; }
    #imageModal .modal-thumbnails { min-height: 52px !important; height: 52px !important; padding: 6px 12px !important; flex-wrap: nowrap !important; gap: 8px !important; }
    .thumb-btn { flex: 0 0 42px !important; height: 42px !important; border-radius: 6px !important; }
    #imageModal #caption { font-size: 1.35rem !important; line-height: 1.25 !important; margin-bottom: 8px !important; }
    #imageModal .modal-description { font-size: 0.95rem !important; line-height: 1.6 !important; }
    #imageModal .modal-action-footer { position: sticky !important; bottom: 0 !important; left: 0 !important; right: 0 !important; width: 100% !important; background: #ffffff !important; padding: 10px 16px 14px 16px !important; border-top: 1px solid #e2e8f0 !important; box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.08) !important; z-index: 30 !important; }
    #imageModal #modalPrice { font-size: 1.15rem !important; padding: 0 0 4px 0 !important; }
    .modal-nav-btn { width: 32px !important; height: 32px !important; font-size: 15px !important; }
    .inquiry-modal-content { padding: 20px !important; }
}