/* =================================
   Modal Styles
   ================================= */

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

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

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

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 3rem;
    box-shadow: var(--shadow-xl);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-small {
    max-width: 450px;
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    background: var(--lighter-gray);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--dark);
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--light-gray);
    transform: rotate(90deg);
}

.modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.modal-header h2 {
    font-family: var(--font-display);
    margin-bottom: 0.5rem;
}

.modal-header p {
    color: var(--gray);
}

.modal-offer {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gradient-success);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-top: 1rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.modal-offer i {
    font-size: 1.25rem;
}

.modal-icon {
    text-align: center;
    margin-bottom: 2rem;
}

.modal-icon i {
    font-size: 4rem;
    color: var(--primary-color);
    animation: bounce 2s infinite;
}

.lead-form {
    margin-top: 2rem;
}

.form-note {
    text-align: center;
    margin-top: 1rem;
    color: var(--gray);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.form-note i {
    color: var(--secondary-color);
}

/* =================================
   Chat Widget
   ================================= */

.chat-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9998;
}

.chat-button {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    color: var(--white);
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
}

.chat-button:hover {
    transform: scale(1.1);
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: var(--white);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    animation: pulse 2s infinite;
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    max-height: 500px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    transform: scale(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}

.chat-window.active {
    transform: scale(1);
}

.chat-header {
    padding: 1.5rem;
    background: var(--gradient-primary);
    color: var(--white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.chat-info {
    flex: 1;
}

.chat-info h4 {
    margin-bottom: 0.25rem;
}

.chat-status {
    font-size: 0.875rem;
    opacity: 0.9;
}

.chat-close {
    width: 30px;
    height: 30px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.chat-close:hover {
    background: rgba(255,255,255,0.3);
}

.chat-messages {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.chat-message {
    max-width: 80%;
    margin-bottom: 1rem;
}

.chat-message.agent {
    margin-right: auto;
}

.chat-message p {
    background: var(--lighter-gray);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.25rem;
}

.message-time {
    font-size: 0.75rem;
    color: var(--gray);
}

.chat-form {
    padding: 1.5rem;
    border-top: 1px solid var(--light-gray);
}

.chat-form .form-group {
    margin-bottom: 1rem;
}

.chat-form input {
    width: 100%;
    padding: 0.75rem;
    background: var(--lighter-gray);
    border-radius: var(--radius-sm);
    border: none;
}

/* =================================
   Loading Overlay
   ================================= */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-overlay p {
    color: var(--white);
    font-size: 1.125rem;
}

/* =================================
   Responsive
   ================================= */

@media (max-width: 768px) {
    .modal-content {
        padding: 2rem;
        max-width: 95%;
    }

    .chat-window {
        width: calc(100vw - 4rem);
        max-width: 350px;
    }

    .chat-widget {
        bottom: 1rem;
        right: 1rem;
    }
}

/* =================================
   Product Modal
   ================================= */

.product-modal .modal-content {
    max-width: 1200px;
    width: 95%;
    padding: 0;
    max-height: 95vh;
}

.product-modal-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 600px;
}

.product-modal-gallery {
    background: #f8f9fa;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.product-main-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.product-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: zoom-in;
}

.product-thumbnails {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.product-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
    background: white;
}

.product-thumbnail:hover,
.product-thumbnail.active {
    border-color: #667eea;
    transform: scale(1.05);
}

.product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-modal-info {
    padding: 3rem;
    overflow-y: auto;
    max-height: 95vh;
}

.product-modal-header {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.product-modal-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    font-family: 'Playfair Display', serif;
}

.product-modal-category {
    color: #667eea;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.product-modal-price {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin: 1.5rem 0;
}

.product-price-current {
    font-size: 2.5rem;
    font-weight: 800;
    color: #667eea;
}

.product-price-original {
    font-size: 1.5rem;
    color: #999;
    text-decoration: line-through;
}

.product-discount-badge {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.product-modal-description {
    line-height: 1.8;
    color: #444;
    margin: 1.5rem 0;
    font-size: 1rem;
}

.product-modal-section {
    margin: 2rem 0;
}

.product-modal-section h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1rem;
    font-family: 'Playfair Display', serif;
}

.product-features-list,
.product-specs-list {
    list-style: none;
    padding: 0;
}

.product-features-list li,
.product-specs-list li {
    padding: 0.75rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #444;
    border-bottom: 1px solid #f0f0f0;
}

.product-features-list li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
    font-size: 1.2rem;
}

.product-specs-list li {
    display: flex;
    justify-content: space-between;
}

.product-specs-list li strong {
    color: #1a1a1a;
    font-weight: 600;
}

.product-modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.product-modal-actions .btn {
    flex: 1;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s;
}

.product-modal-actions .btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
}

.product-modal-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.product-modal-actions .btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.product-modal-actions .btn-secondary:hover {
    background: #f8f9fa;
}

.product-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 10;
    transition: all 0.3s;
}

.product-modal-close:hover {
    background: rgba(0,0,0,0.7);
    transform: rotate(90deg);
}

@media (max-width: 992px) {
    .product-modal-inner {
        grid-template-columns: 1fr;
    }

    .product-modal-gallery {
        max-height: 400px;
    }

    .product-modal .modal-content {
        max-height: 90vh;
    }
}

/* Product Modal - Full Description Styles */
.product-modal-description {
    margin: 2rem 0;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.product-modal-description h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.description-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #555;
}

.description-content p {
    margin-bottom: 1rem;
}

.description-content h4,
.description-content h5,
.description-content h6 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--dark);
    font-weight: 600;
}

.description-content h4 {
    font-size: 1.3rem;
}

.description-content h5 {
    font-size: 1.15rem;
}

.description-content h6 {
    font-size: 1.05rem;
}

.description-content ul {
    margin: 1rem 0;
    padding-left: 0;
    list-style: none;
}

.description-content ul li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
}

.description-content ul li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #4facfe;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Specifications Table */
.specs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.specs-table tr {
    border-bottom: 1px solid #e8eaed;
}

.specs-table tr:last-child {
    border-bottom: none;
}

.specs-table th {
    background: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    width: 40%;
}

.specs-table td {
    padding: 1rem;
    color: #555;
}

.specs-table tr:hover {
    background: #fafbfc;
}

/* Scrollable modal content */
.product-modal-info {
    overflow-y: auto;
    max-height: 85vh;
    padding-right: 0.5rem;
}

.product-modal-info::-webkit-scrollbar {
    width: 8px;
}

.product-modal-info::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.product-modal-info::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.product-modal-info::-webkit-scrollbar-thumb:hover {
    background: #555;
}
