/* ============================================
   MAGNIFICENT FURNITURES LIMITED - COMPONENTS
   Reusable UI Components
   Version 2.0 - With Back to Top Button
   ============================================ */

/* ---------- BUTTON VARIANTS ---------- */
.btn-lg {
    padding: 16px 40px;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 8px 20px;
    font-size: 0.85rem;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-danger {
    background: #EF4444;
    color: white;
}

.btn-danger:hover {
    background: #DC2626;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

/* ---------- PRODUCT CARD VARIANTS ---------- */
.product-card-featured {
    border: 2px solid var(--accent-color);
    position: relative;
}

.featured-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-color);
    color: var(--text-dark);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
}

.product-card-sale {
    position: relative;
}

.sale-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #EF4444;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
}

.old-price {
    text-decoration: line-through;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-right: 10px;
}

/* ---------- FORM STYLES ---------- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
}

/* ---------- CONTACT FORM ---------- */
.contact-form {
    background: var(--bg-white);
    padding: 40px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ---------- MODAL STYLES ---------- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

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

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin-bottom: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ---------- PRODUCT DETAIL MODAL ---------- */
.product-detail-modal .modal-content {
    max-width: 900px;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.product-detail-image img {
    width: 100%;
    border-radius: var(--border-radius-md);
}

.product-detail-info h4 {
    color: var(--accent-color);
    font-size: 1.5rem;
    margin: 15px 0;
}

.specs-list {
    list-style: none;
    margin: 20px 0;
}

.specs-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
}

.spec-label {
    font-weight: 600;
    width: 120px;
}

.spec-value {
    color: var(--text-light);
}

/* ---------- PAGINATION ---------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    color: var(--text-dark);
}

.pagination a:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--text-dark);
}

.pagination .active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--text-dark);
}

.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---------- ALERTS & NOTIFICATIONS ---------- */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: #ECFDF5;
    border-left-color: var(--success-color);
    color: #065F46;
}

.alert-error {
    background: #FEF2F2;
    border-left-color: #EF4444;
    color: #991B1B;
}

.alert-info {
    background: #EFF6FF;
    border-left-color: #3B82F6;
    color: #1E40AF;
}

.alert-warning {
    background: #FFFBEB;
    border-left-color: #F59E0B;
    color: #92400E;
}

/* ---------- BREADCRUMBS ---------- */
.breadcrumb {
    padding: 15px 0;
    background: var(--bg-light);
    margin-bottom: 30px;
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.breadcrumb-list li {
    display: inline;
}

.breadcrumb-list li a {
    color: var(--text-light);
    transition: var(--transition);
}

.breadcrumb-list li a:hover {
    color: var(--accent-color);
}

.breadcrumb-list li:not(:last-child):after {
    content: '/';
    margin-left: 10px;
    color: var(--text-light);
}

/* ---------- FILTER SIDEBAR ---------- */
.filter-sidebar {
    background: var(--bg-white);
    border-radius: var(--border-radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.filter-group {
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.filter-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.filter-title {
    font-weight: 600;
    margin-bottom: 15px;
    display: block;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-light);
}

.filter-options input[type="checkbox"],
.filter-options input[type="radio"] {
    cursor: pointer;
}

.price-range {
    display: flex;
    gap: 10px;
    align-items: center;
}

.price-range input {
    width: 100px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
}

/* ---------- LOADING SPINNER ---------- */
.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ---------- EMPTY STATE ---------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 20px;
}

/* ---------- TOAST NOTIFICATION ---------- */
.toast {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: var(--text-dark);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    z-index: 1500;
    animation: slideInRight 0.3s ease;
    box-shadow: var(--shadow-lg);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ---------- BACK TO TOP BUTTON ---------- */
.back-to-top {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: var(--accent-color);
    color: var(--text-dark);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* ---------- RESPONSIVE COMPONENTS ---------- */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .contact-form {
        padding: 25px;
    }
    
    .product-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-sidebar {
        margin-bottom: 20px;
    }
    
    .pagination a, .pagination span {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .toast {
        bottom: 80px;
        right: 20px;
        left: 20px;
        text-align: center;
    }
    
    .back-to-top {
        bottom: 80px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}