/* Rohini Threads - Reusable Components */

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

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

.btn-primary:hover {
    background: #e09520;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.4);
}

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

.btn-secondary:hover {
    background: #247a87;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-whatsapp {
    background: #25D366;
    color: white;
}

.btn-whatsapp:hover {
    background: #20bd5a;
}

.btn-danger {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.btn-danger:hover {
    background: var(--accent-color);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.125rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   Badges
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.badge-sale {
    background: var(--accent-color);
    color: white;
}

.badge-bestseller {
    background: var(--secondary-color);
    color: white;
    top: auto;
    bottom: 10px;
    left: 10px;
}

.badge-new {
    background: var(--primary-color);
    color: white;
}

/* Cart & Wishlist Badges */
.cart-badge,
.wishlist-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--dark-color);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-success {
    background: #25D366;
}

.toast-error {
    background: var(--accent-color);
}

.toast-warning {
    background: var(--primary-color);
}

.toast-info {
    background: var(--secondary-color);
}

.toast-icon {
    font-size: 1.2rem;
}

.toast-message {
    font-size: 0.95rem;
}

/* ============================================
   Modal
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-lg {
    max-width: 800px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    z-index: 1;
}

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

.modal-body {
    padding: 30px;
}

body.modal-open {
    overflow: hidden;
}

/* Quick View Modal */
.quick-view-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.quick-view-image img {
    width: 100%;
    border-radius: 8px;
}

.quick-view-details h2 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.quick-view-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.quick-view-price .price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.quick-view-price .original-price {
    font-size: 1.1rem;
    color: #999;
    text-decoration: line-through;
}

.quick-view-price .discount-badge {
    background: var(--accent-color);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.quick-view-description {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.quick-view-meta {
    margin-bottom: 20px;
}

.quick-view-meta p {
    margin: 5px 0;
    color: #555;
}

.quick-view-actions {
    display: flex;
    gap: 10px;
}

@media (max-width: 768px) {
    .quick-view-content {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Hamburger Menu
   ============================================ */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger span {
    width: 100%;
    height: 3px;
    background: var(--dark-color);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

body.nav-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: 80px 30px 30px;
        gap: 0;
        z-index: 999;
        transition: right 0.3s ease;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        right: 0;
        display: flex;
    }

    .nav-links li {
        margin: 0;
    }

    .nav-links a {
        display: block;
        padding: 15px 0;
        border-bottom: 1px solid #eee;
    }
}

/* ============================================
   Header Icons
   ============================================ */
.nav-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
    color: var(--dark-color);
    text-decoration: none;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.nav-icon:hover {
    background: var(--light-color);
    color: var(--primary-color);
}

/* ============================================
   Search Bar
   ============================================ */
.search-container {
    position: relative;
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
}

.search-form {
    display: flex;
    align-items: center;
    background: var(--light-color);
    border-radius: 25px;
    padding: 8px 15px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.search-form:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
}

.search-form input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 5px 10px;
    font-size: 0.95rem;
    outline: none;
}

.search-form button {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    font-size: 1.1rem;
}

.search-form button:hover {
    color: var(--primary-color);
}

/* Live Search Dropdown */
.live-search-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-top: 5px;
    max-height: 400px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.live-search-container.active {
    opacity: 1;
    visibility: visible;
}

.search-section {
    padding: 15px;
}

.search-section h5 {
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--dark-color);
    transition: background 0.2s;
}

.search-result-item:hover {
    background: var(--light-color);
}

.search-result-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
}

.search-result-info {
    display: flex;
    flex-direction: column;
}

.search-result-name {
    font-weight: 500;
}

.search-result-name mark {
    background: rgba(245, 166, 35, 0.3);
    color: inherit;
}

.search-result-price {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.search-view-all {
    display: block;
    padding: 15px;
    text-align: center;
    color: var(--primary-color);
    font-weight: 500;
    border-top: 1px solid #eee;
    text-decoration: none;
}

.search-view-all:hover {
    background: var(--light-color);
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: #666;
}

.search-no-results a {
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .search-container {
        display: none;
    }

    .mobile-search {
        display: block;
        padding: 15px 20px;
        background: white;
        border-bottom: 1px solid #eee;
    }

    .mobile-search .search-form {
        max-width: 100%;
    }
}

/* ============================================
   Breadcrumb
   ============================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px 0;
    font-size: 0.9rem;
    color: #666;
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb span:last-child {
    color: var(--dark-color);
    font-weight: 500;
}

/* ============================================
   Lightbox
   ============================================ */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
    left: -70px;
}

.lightbox-next {
    right: -70px;
}

.lightbox-counter {
    text-align: center;
    color: white;
    margin-top: 15px;
    font-size: 0.9rem;
}

body.lightbox-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }
}

/* ============================================
   Loading States
   ============================================ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   Empty States
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.empty-state p {
    color: #666;
    margin-bottom: 20px;
}

/* ============================================
   Form Elements
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

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

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
}

textarea.form-input {
    min-height: 120px;
    resize: vertical;
}

/* ============================================
   Star Rating
   ============================================ */
.stars {
    color: #ffc107;
    font-size: 1rem;
    letter-spacing: 2px;
}

.stars-lg {
    font-size: 1.5rem;
}

/* ============================================
   Tags
   ============================================ */
.tag {
    display: inline-block;
    padding: 5px 12px;
    background: var(--light-color);
    border-radius: 20px;
    font-size: 0.85rem;
    color: #666;
    margin: 3px;
    text-decoration: none;
    transition: all 0.2s;
}

.tag:hover {
    background: var(--primary-color);
    color: white;
}

/* ============================================
   Stock Status
   ============================================ */
.in-stock {
    color: #25D366;
    font-weight: 500;
}

.out-of-stock {
    color: var(--accent-color);
    font-weight: 500;
}
