/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #e8e8e8, #a6909d 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #0a0508;
    font-size: 28px;
}

nav {
    display: flex;
    gap: 15px;
}

.btn-nav {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-nav:hover, .btn-nav.active {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Main Content */
main {
    padding: 40px 20px;
    min-height: calc(100vh - 160px);
}

/* Gallery Header */
.gallery-header {
    text-align: center;
    margin-bottom: 40px;
}

.gallery-header h2 {
    color: white;
    font-size: 36px;
    margin-bottom: 20px;
}

.search-box {
    max-width: 500px;
    margin: 0 auto;
}

.search-box input {
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    outline: none;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.product-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.btn-view {
    padding: 12px 30px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-view:hover {
    background: #764ba2;
    color: white;
    transform: scale(1.05);
}

.product-info {
    padding: 20px;
}

.category {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.product-info h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #333;
}

.description {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.price {
    font-size: 24px;
    font-weight: bold;
    color: #00b894;
}

.btn-buy {
    padding: 10px 20px;
    background: #00b894;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-buy:hover {
    background: #00a085;
    transform: scale(1.05);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 35px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #000;
}

/* Upload Section */
.upload-section {
    background: white;
    border-radius: 15px;
    padding: 40px;
    max-width: 700px;
    margin: 0 auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.upload-section h2 {
    color: #667eea;
    font-size: 32px;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.file-upload {
    position: relative;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-label {
    display: block;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 2px dashed #667eea;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.file-label:hover {
    background: #e9ecef;
    border-color: #764ba2;
}

.image-preview {
    margin-top: 15px;
    display: none;
}

.image-preview img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn-submit,
.btn-reset {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-submit {
    background: #667eea;
    color: white;
}

.btn-submit:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-reset {
    background: #e0e0e0;
    color: #333;
}

.btn-reset:hover {
    background: #d0d0d0;
}

.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Messages */
.message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.no-products {
    text-align: center;
    color: white;
    font-size: 18px;
    padding: 40px;
    grid-column: 1 / -1;
}

.no-products a {
    color: #ffeaa7;
    text-decoration: underline;
}

/* Footer */
footer {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    text-align: center;
    color: #666;
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 15px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .upload-section {
        padding: 25px;
    }

    .form-actions {
        flex-direction: column;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 22px;
    }

    .gallery-header h2 {
        font-size: 28px;
    }
}
/* Product Details Container */
.product-details-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.product-image-container {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.detail-image {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 10px;
    cursor: zoom-in;
    transition: all 0.3s ease;
    background: #f8f9fa;
    padding: 10px;
}

.detail-image:hover {
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    transform: scale(1.02);
}

.magnifier-hint {
    margin-top: 15px;
    text-align: center;
    color: #667eea;
    font-size: 14px;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.product-details-info {
    padding: 20px;
}

.product-details-info h2 {
    color: #333;
    font-size: 28px;
    margin-bottom: 15px;
}

.product-details-info .category {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    margin-bottom: 15px;
}

/* Image Viewer Modal */
.image-viewer-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

.image-viewer-container {
    position: relative;
    width: 90%;
    height: 90vh;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-viewer-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.viewer-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: grab;
    transition: transform 0.2s ease;
    user-select: none;
}

.viewer-image:active {
    cursor: grabbing;
}

.image-viewer-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 2001;
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.image-viewer-close:hover {
    color: #ff6b6b;
    background: rgba(0, 0, 0, 0.7);
    transform: rotate(90deg);
}

/* Zoom Controls */
.zoom-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 20px;
    border-radius: 50px;
    z-index: 2001;
}

.zoom-btn {
    padding: 12px 18px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
}

.zoom-btn:hover {
    background: #764ba2;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
}

.zoom-btn:active {
    transform: scale(0.95);
}

/* Magnifier Glass */
.magnifier-glass {
    position: absolute;
    width: 150px;
    height: 150px;
    border: 3px solid #667eea;
    border-radius: 50%;
    display: none;
    pointer-events: none;
    background-size: 300px 300px;
    background-position: 0px 0px;
    box-shadow: 
        0 0 0 1px rgba(102, 126, 234, 0.5),
        0 0 10px rgba(102, 126, 234, 0.3),
        inset 0 0 10px rgba(0, 0, 0, 0.3);
    z-index: 2002;
}

/* Responsive Design for Details Modal */
@media (max-width: 768px) {
    .product-details-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .detail-image {
        max-height: 400px;
    }

    .image-viewer-container {
        width: 95%;
        height: 80vh;
        border-radius: 10px;
    }

    .zoom-controls {
        bottom: 20px;
        padding: 10px 15px;
        gap: 10px;
    }

    .zoom-btn {
        padding: 10px 15px;
        min-width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .image-viewer-close {
        width: 45px;
        height: 45px;
        font-size: 35px;
        top: 15px;
        right: 15px;
    }
}

@media (max-width: 480px) {
    .product-details-info h2 {
        font-size: 22px;
    }

    .zoom-controls {
        padding: 8px 12px;
    }

    .zoom-btn {
        padding: 8px 12px;
        min-width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .magnifier-glass {
        width: 100px;
        height: 100px;
    }
}

/* Mobile-first sizing improvements */
.modal-content {
    width: 95%;
    max-width: 640px;
}

/* Product details grid becomes single column on small screens */
@media (max-width: 768px) {
    .product-details-container {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    .product-details-info {
        padding: 0 !important;
    }
    .detail-image {
        max-height: 55vh !important;
        width: 100%;
        object-fit: contain;
    }
}

/* Full-screen image viewer should truly fill and adapt */
.image-viewer-modal {
    display: none;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh; /* dynamic viewport on mobile browsers */
    background-color: rgba(0, 0, 0, 0.98);
    justify-content: center;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}

.image-viewer-container {
    width: 100%;
    height: 100%;
    background: transparent;
    border-radius: 0;
}

/* The scrollable wrapper handles panning on zoom */
.image-viewer-wrapper {
    width: 100%;
    height: 100%;
    overflow: auto;
    overscroll-behavior: contain;
    touch-action: none; /* we’ll set per-element gestures in JS */
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center center;
    user-select: none;
    -webkit-user-drag: none;
    will-change: transform;
}

/* Controls positioning that works on phones */
.zoom-controls {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
    gap: 12px;
    padding: 10px 12px;
    border-radius: 999px;
}

.image-viewer-close {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    right: 12px;
}

/* Reduce control sizes for very small screens */
@media (max-width: 480px) {
    .zoom-btn {
        min-width: 38px;
        height: 38px;
        font-size: 16px;
        padding: 8px 10px;
    }
    .image-viewer-close {
        width: 42px;
        height: 42px;
        font-size: 32px;
    }
    /* Smaller magnifier on small screens, or hide it */
    .magnifier-glass {
        width: 90px;
        height: 90px;
    }
}

/* ============= BUYER MODAL STYLES ============= */

.buyer-modal-content {
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
}

.buyer-modal-content h2 {
    color: #333;
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group textarea {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Location Input Group */
.location-input-group {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

.location-input-group input {
    grid-column: 1;
}

.btn-get-location {
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-get-location:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-get-location:active {
    transform: translateY(0);
}

.btn-get-location:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Location Status */
.location-status {
    font-size: 13px;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    display: none;
}

.location-status.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.location-status.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Message Box */
#buyerMessageBox {
    margin-bottom: 20px;
}

.message {
    padding: 15px;
    border-radius: 8px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Actions */
.form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 25px;
}

.btn-submit,
.btn-reset {
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-submit {
    background: linear-gradient(135deg, #00b894 0%, #00a876 100%);
    color: white;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 184, 148, 0.4);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-reset {
    background: #e0e0e0;
    color: #333;
}

.btn-reset:hover {
    background: #d0d0d0;
}

/* Loader Spinner */
.loader {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-reset .loader {
    border-color: rgba(0, 0, 0, 0.3);
    border-top-color: #333;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design for Buyer Modal */
@media (max-width: 480px) {
    .buyer-modal-content {
        width: 96%;
        max-width: 100%;
        padding: 20px;
    }

    .buyer-modal-content h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .location-input-group {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .btn-get-location {
        width: 100%;
        justify-content: center;
    }

    .form-actions {
        grid-template-columns: 1fr;
    }

    .form-group input,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Modal Styling Enhancement */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    margin-top: 5vh;
    margin-bottom: 5vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    padding: 10px 15px;
    transition: all 0.3s;
}

.close:hover,
.close:focus {
    color: #000;
    transform: rotate(90deg);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Product Details Container */
.product-details-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
    padding: 30px;
}

.product-image-container {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.detail-image {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 10px;
    cursor: zoom-in;
    transition: all 0.3s ease;
    background: #f8f9fa;
    padding: 10px;
}

.detail-image:hover {
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    transform: scale(1.02);
}

.magnifier-hint {
    margin-top: 15px;
    text-align: center;
    color: #667eea;
    font-size: 14px;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.product-details-info {
    padding: 0;
}

.product-details-info h2 {
    color: #333;
    font-size: 28px;
    margin-bottom: 15px;
}

.product-details-info .category {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    margin-bottom: 15px;
}

/* Mobile Responsive for Product Details */
@media (max-width: 768px) {
    .product-details-container {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 20px;
    }

    .product-details-info {
        padding: 0;
    }

    .detail-image {
        max-height: 400px;
    }

    .product-details-info h2 {
        font-size: 22px;
    }
}

/* Image Viewer Styles */
.image-viewer-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100dvh;
    background-color: rgba(0, 0, 0, 0.98);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

.image-viewer-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: transparent;
    border-radius: 0;
}

.image-viewer-wrapper {
    width: 100%;
    height: 100%;
    overflow: auto;
    overscroll-behavior: contain;
    touch-action: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center center;
    user-select: none;
    -webkit-user-drag: none;
    will-change: transform;
}

.zoom-controls {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
    gap: 12px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    z-index: 2001;
}

.zoom-btn {
    padding: 12px 18px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
}

.zoom-btn:hover {
    background: #764ba2;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
}

.zoom-btn:active {
    transform: scale(0.95);
}

.image-viewer-close {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    right: 12px;
    width: 50px;
    height: 50px;
    font-size: 40px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 2001;
}

.image-viewer-close:hover {
    color: #ff6b6b;
    background: rgba(0, 0, 0, 0.7);
    transform: rotate(90deg);
}

.magnifier-glass {
    position: absolute;
    width: 150px;
    height: 150px;
    border: 3px solid #667eea;
    border-radius: 50%;
    display: none;
    pointer-events: none;
    background-size: 300px 300px;
    background-position: 0px 0px;
    box-shadow: 
        0 0 0 1px rgba(102, 126, 234, 0.5),
        0 0 10px rgba(102, 126, 234, 0.3),
        inset 0 0 10px rgba(0, 0, 0, 0.3);
    z-index: 2002;
}

/* Mobile Responsive Image Viewer */
@media (max-width: 768px) {
    .zoom-btn {
        min-width: 38px;
        height: 38px;
        font-size: 16px;
        padding: 8px 10px;
    }

    .image-viewer-close {
        width: 42px;
        height: 42px;
        font-size: 32px;
    }

    .magnifier-glass {
        width: 90px;
        height: 90px;
    }
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 40px;
    font-size: 16px;
    color: #667eea;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 3px solid #667eea;
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

/* Container Styling */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.gallery-header {
    text-align: center;
    margin: 30px 0;
}

.gallery-header h2 {
    font-size: 32px;
    color: #333;
    margin-bottom: 10px;
}

.gallery-subtitle {
    color: #666;
    font-size: 16px;
    margin-bottom: 20px;
}

.search-box {
    position: relative;
    max-width: 400px;
    margin: 20px auto;
}

.search-box input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

/* Product Card */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.product-image {
    position: relative;
    width: 100%;
    height: 250px;
    background: #f5f5f5;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(102, 126, 234, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.btn-view {
    padding: 12px 25px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-view:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

.product-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-info .category {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    margin-bottom: 10px;
    width: fit-content;
}

.product-info h3 {
    color: #333;
    font-size: 16px;
    margin: 8px 0;
    flex: 1;
}

.product-info .description {
    color: #666;
    font-size: 13px;
    margin-bottom: 10px;
    line-height: 1.4;
    flex: 1;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.product-footer .price {
    font-size: 20px;
    font-weight: 700;
    color: #00b894;
}

.btn-buy {
    padding: 8px 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 13px;
}

.btn-buy:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* No Products Message */
.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

.no-products a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.no-products a:hover {
    text-decoration: underline;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 24px;
    margin: 0;
}

header nav {
    display: flex;
    gap: 20px;
}

.btn-nav {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-nav:hover,
.btn-nav.active {
    background: rgba(255, 255, 255, 0.2);
}

/* Footer */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 50px;
}

footer p {
    margin: 0;
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 15px;
    }

    header h1 {
        font-size: 20px;
    }

    header nav {
        gap: 10px;
        width: 100%;
        justify-content: center;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }

    .gallery-header h2 {
        font-size: 24px;
    }

    .modal-content {
        margin: 10vh auto;
        max-width: 95%;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 18px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-header h2 {
        font-size: 20px;
    }

    .search-box input {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .modal-content {
        border-radius: 12px;
        margin: 20px 5px;
    }

    main {
        padding: 15px 0;
    }
}

/* ============= WHATSAPP CHAT BUTTON ============= */

.whatsapp-chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideUp 0.5s ease;
}

.whatsapp-bubble {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25d366 0%, #20c85f 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    font-size: 32px;
    line-height: 1;
    position: relative;
}

.whatsapp-bubble:hover {
    transform: scale(1.15);
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.6);
}

.whatsapp-bubble:active {
    transform: scale(0.95);
}

/* Pulse animation for attention */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(37, 211, 102, 0.8);
    }
}

.whatsapp-bubble.pulse {
    animation: pulse 2s infinite;
}

/* Online indicator */
.whatsapp-online {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #31a24c;
    border: 2px solid white;
    border-radius: 50%;
    bottom: 0;
    right: 0;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Tooltip/label */
.whatsapp-label {
    background: white;
    color: #333;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Chat menu overlay */
.whatsapp-chat-menu {
    display: none;
    position: fixed;
    bottom: 90px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    z-index: 998;
    animation: slideUp 0.3s ease;
}

.whatsapp-chat-menu.active {
    display: block;
}

.whatsapp-menu-header {
    background: linear-gradient(135deg, #25d366 0%, #20c85f 100%);
    color: white;
    padding: 15px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.whatsapp-menu-header span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

.whatsapp-menu-item {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 12px;
}

.whatsapp-menu-item:last-child {
    border-bottom: none;
}

.whatsapp-menu-item:hover {
    background: #f8f8f8;
}

.whatsapp-menu-item-icon {
    font-size: 20px;
}

.whatsapp-menu-item-text {
    display: flex;
    flex-direction: column;
}

.whatsapp-menu-item-name {
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.whatsapp-menu-item-status {
    font-size: 12px;
    color: #999;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .whatsapp-chat-button {
        bottom: 15px;
        right: 15px;
    }

    .whatsapp-bubble {
        width: 55px;
        height: 55px;
        font-size: 28px;
    }

    .whatsapp-label {
        display: none;
    }

    .whatsapp-chat-menu {
        bottom: 80px;
        right: 15px;
        max-width: 90vw;
    }

    .whatsapp-menu-item {
        padding: 12px;
        font-size: 13px;
    }

    .whatsapp-menu-item-icon {
        font-size: 18px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .whatsapp-label {
        background: #2a2a2a;
        color: #fff;
    }

    .whatsapp-menu-item {
        color: #ddd;
        border-bottom-color: #333;
    }

    .whatsapp-menu-item:hover {
        background: #333;
    }

    .whatsapp-menu-item-status {
        color: #666;
    }

    .whatsapp-menu-item-name {
        color: #ddd;
    }
}

/* Hide label on hover to show bubble */
.whatsapp-chat-button:hover .whatsapp-label {
    display: none;
}

.whatsapp-chat-button:not(:hover) .whatsapp-label {
    display: block;
}

