/* =============================================
   PRODUCT MODAL & SEARCH ENHANCEMENTS
   GllenMaxx Enhanced Features
   ============================================= */

/* =============================================
   PRODUCT MODAL
   ============================================= */

.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.product-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    max-width: 1100px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(0);
    transition: transform 0.3s ease;
    z-index: 1;
}

.product-modal.active .modal-content {
    transform: scale(1) translateY(0);
    animation: modalZoomIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalZoomIn {
    0% {
        opacity: 0;
        transform: scale(0.7) translateY(40px);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #333;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modal-close:hover {
    background: #f44336;
    color: white;
    transform: rotate(90deg) scale(1.1);
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.modal-image-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 60px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px 0 0 20px;
}

.modal-image-container {
    width: 100%;
    max-width: 450px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.modal-product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: productZoomIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.15));
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-product-image:hover {
    transform: scale(1.08) rotateY(-5deg);
}

@keyframes productZoomIn {
    0% {
        opacity: 0;
        transform: scale(0.6) rotateX(20deg);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateX(0);
    }
}

.modal-info-section {
    padding: 60px 50px;
    overflow-y: auto;
    max-height: 90vh;
}

.modal-title {
    font-size: 32px;
    font-weight: 700;
    color: #2d7f4e;
    margin: 0 0 15px 0;
    line-height: 1.2;
    animation: slideDown 0.5s ease-out 0.1s both;
}

.modal-price {
    font-size: 36px;
    font-weight: 800;
    color: #f8a100;
    margin: 0 0 25px 0;
    animation: slideDown 0.5s ease-out 0.2s both;
}

.modal-description {
    font-size: 16px;
    line-height: 1.7;
    color: #555;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 2px solid #e9ecef;
    animation: slideDown 0.5s ease-out 0.3s both;
}

.modal-features {
    margin-bottom: 30px;
    animation: slideDown 0.5s ease-out 0.4s both;
}

.modal-features h3 {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-features h3 i {
    color: #f8a100;
}

.modal-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-features li {
    padding: 12px 0;
    font-size: 15px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-features li:last-child {
    border-bottom: none;
}

.modal-features li i {
    color: #2d7f4e;
    font-size: 18px;
    flex-shrink: 0;
}

.modal-details {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    animation: slideDown 0.5s ease-out 0.5s both;
}

.detail-item {
    margin-bottom: 20px;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-item h4 {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-item h4 i {
    color: #2d7f4e;
}

.detail-item p {
    margin: 0;
    font-size: 15px;
    color: #666;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 15px;
    animation: slideDown 0.5s ease-out 0.6s both;
}

.modal-add-cart {
    flex: 1;
    background: linear-gradient(135deg, #2d7f4e 0%, #1a5a32 100%);
    color: white;
    border: none;
    padding: 18px 35px;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(45, 127, 78, 0.3);
}

.modal-add-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 127, 78, 0.4);
}

.modal-add-cart:active {
    transform: translateY(0);
}

.modal-wishlist {
    width: 60px;
    height: 60px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #999;
    transition: all 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-wishlist:hover {
    border-color: #f44336;
    color: #f44336;
    transform: scale(1.1);
}

/* =============================================
   SEARCH ENHANCEMENTS
   ============================================= */

/* Search autocomplete dropdown */
.search-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #2d7f4e;
    border-top: none;
    border-radius: 0 0 20px 20px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    animation: autocompleteDropdown 0.2s ease-out;
    margin-top: -2px;
}

@keyframes autocompleteDropdown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.autocomplete-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    color: #333;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: #f0f8f4;
    color: #2d7f4e;
    transform: translateX(5px);
}

.autocomplete-item i {
    color: #2d7f4e;
    font-size: 16px;
    flex-shrink: 0;
}

.autocomplete-name {
    font-weight: 600;
    font-size: 15px;
}

.autocomplete-tagline {
    font-size: 13px;
    color: #999;
    margin-left: auto;
    flex-shrink: 0;
}

.search-highlight {
    animation: highlightPulse 0.6s ease-out;
    position: relative;
}

@keyframes highlightPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 5px 20px rgba(45, 127, 78, 0);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 5px 20px rgba(45, 127, 78, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 5px 20px rgba(45, 127, 78, 0);
    }
}

.search-results-message {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #2d7f4e;
    border-radius: 15px;
    padding: 30px;
    margin: 0 0 40px 0;
    text-align: center;
    animation: slideDown 0.4s ease-out;
}

.search-results-message i {
    font-size: 48px;
    color: #2d7f4e;
    margin-bottom: 15px;
    display: block;
}

.search-results-message p {
    font-size: 18px;
    color: #333;
    margin: 0 0 20px 0;
}

.search-suggestion {
    font-size: 14px !important;
    color: #666 !important;
    margin: 15px 0 20px 0 !important;
    font-style: italic;
}

.search-results-message strong {
    color: #2d7f4e;
    font-weight: 700;
}

.clear-search-btn {
    background: #2d7f4e;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-search-btn:hover {
    background: #1a5a32;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 127, 78, 0.3);
}

/* Product card search effect */
.product-card {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */

@media (max-width: 992px) {
    .modal-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-image-section {
        border-radius: 20px 20px 0 0;
        padding: 40px 30px;
    }
    
    .modal-info-section {
        padding: 40px 30px;
    }
    
    .modal-title {
        font-size: 26px;
    }
    
    .modal-price {
        font-size: 30px;
    }
    
    .search-autocomplete {
        max-height: 350px;
    }
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
        border-radius: 15px;
    }
    
    .modal-image-section {
        padding: 30px 20px;
        border-radius: 15px 15px 0 0;
    }
    
    .modal-info-section {
        padding: 30px 25px;
    }
    
    .modal-title {
        font-size: 22px;
    }
    
    .modal-price {
        font-size: 26px;
    }
    
    .modal-description {
        font-size: 15px;
    }
    
    .modal-features h3 {
        font-size: 18px;
    }
    
    .modal-features li {
        font-size: 14px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-wishlist {
        width: 100%;
        height: 55px;
    }
    
    .search-results-message {
        padding: 20px;
        margin-bottom: 30px;
    }
    
    .search-results-message i {
        font-size: 36px;
    }
    
    .search-results-message p {
        font-size: 16px;
    }
    
    .search-autocomplete {
        max-height: 280px;
        border-radius: 0 0 12px 12px;
    }
    
    .autocomplete-item {
        padding: 12px 15px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .modal-close {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .modal-image-section {
        padding: 25px 15px;
    }
    
    .modal-info-section {
        padding: 25px 20px;
    }
    
    .modal-title {
        font-size: 20px;
    }
    
    .modal-price {
        font-size: 24px;
    }
    
    .modal-add-cart {
        padding: 15px 25px;
        font-size: 16px;
    }
    
    .search-autocomplete {
        max-height: 250px;
        font-size: 13px;
    }
    
    .autocomplete-item {
        padding: 10px 12px;
    }
    
    .autocomplete-name {
        font-size: 14px;
    }
}

/* Scrollbar styling for modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #2d7f4e;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #1a5a32;
}

.modal-info-section::-webkit-scrollbar {
    width: 6px;
}

.modal-info-section::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.modal-info-section::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}
