/**
 * Components CSS for Al-Anika Store Theme
 * 
 * @package AlAnikaStore
 * @version 1.0.0
 */

/* ==========================================================================
   Header Components
   ========================================================================== */

/* Search Dropdown */
.search-suggestions {
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
    max-height: 400px;
    overflow-y: auto;
}

.search-suggestions.active {
    display: block;
}

.suggestions-header {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    color: #374151;
}

.close-suggestions {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: 1.2rem;
}

.suggestions-list {
    padding: 0.5rem 0;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.suggestion-item:hover {
    background: #f9fafb;
}

.suggestion-icon {
    color: var(--primary-color);
    width: 20px;
}

.suggestion-text {
    flex: 1;
}

.suggestion-category {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Cart Dropdown */
.cart-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 350px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
    max-height: 500px;
    overflow: hidden;
}

.cart-action:hover .cart-dropdown {
    display: block;
}

.cart-dropdown.active {
    display: block;
}

.cart-header {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #374151;
}

.close-cart {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: 1.2rem;
}

.cart-items {
    max-height: 300px;
    overflow-y: auto;
}

.cart-empty {
    padding: 2rem;
    text-align: center;
    color: #6b7280;
}

.cart-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #d1d5db;
}

.cart-empty p {
    margin-bottom: 1.5rem;
}

.cart-footer {
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-weight: bold;
    font-size: 1.1rem;
}

.cart-item {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    gap: 1rem;
}

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

.cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-title {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.quantity-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
}

.quantity-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ==========================================================================
   Product Components
   ========================================================================== */

/* Product Card */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 10;
}

.product-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.product-badge.sale {
    background: #ef4444;
    color: white;
}

.product-badge.new {
    background: #10b981;
    color: white;
}

.product-badge.stock {
    background: #6b7280;
    color: white;
}

.quick-view-btn {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
}

.product-card:hover .quick-view-btn {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.product-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-title a {
    color: inherit;
    text-decoration: none;
}

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

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.stars {
    display: flex;
    gap: 2px;
}

.star {
    color: #fbbf24;
    font-size: 0.875rem;
}

.star.empty {
    color: #d1d5db;
}

.rating-text {
    font-size: 0.875rem;
    color: #6b7280;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.current-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
}

.original-price {
    font-size: 1rem;
    color: #9ca3af;
    text-decoration: line-through;
}

.discount-badge {
    background: #fee2e2;
    color: #dc2626;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

.product-actions {
    margin-top: auto;
    display: flex;
    gap: 0.5rem;
}

.btn-product {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

.btn-add-cart:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-wishlist {
    background: white;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    width: 45px;
    padding: 0.75rem 0;
}

.btn-wishlist:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-wishlist.active {
    background: #fee2e2;
    color: #dc2626;
    border-color: #dc2626;
}

/* ==========================================================================
   Advertisement Banner Components
   ========================================================================== */

.ad-banner {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.ad-banner img {
    width: 100%;
    height: auto;
    display: block;
}

.ad-banner .ad-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    color: white;
    text-align: center;
    padding: 2rem;
}

.ad-banner .ad-title {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.ad-banner .ad-description {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.ad-banner .ad-button {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.ad-banner .ad-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Ad Carousel */
.ad-carousel {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.ad-carousel .slick-dots {
    position: absolute;
    bottom: 15px;
    right: 50%;
    transform: translateX(50%);
    display: flex;
    gap: 8px;
}

.ad-carousel .slick-dots li button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    font-size: 0;
}

.ad-carousel .slick-dots li.slick-active button {
    background: white;
}

.ad-carousel .slick-prev,
.ad-carousel .slick-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
}

.ad-carousel .slick-prev {
    right: 15px;
}

.ad-carousel .slick-next {
    left: 15px;
}

.ad-carousel .slick-prev:hover,
.ad-carousel .slick-next:hover {
    background: rgba(0,0,0,0.8);
}

/* ==========================================================================
   Sidebar Components
   ========================================================================== */

.widget {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

/* Price Range Filter */
.price-range {
    padding: 1rem 0;
}

.price-inputs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.price-inputs input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    text-align: center;
}

.price-slider {
    position: relative;
    height: 6px;
    background: #f3f4f6;
    border-radius: 3px;
    margin: 1rem 0;
}

.price-slider .slider-track {
    position: absolute;
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
}

.price-slider .slider-thumb {
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transform: translate(-50%, -50%);
    top: 50%;
    z-index: 10;
}

/* Category Filter */
.category-filter {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-filter li {
    margin-bottom: 0.5rem;
}

.category-filter a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    color: #6b7280;
    text-decoration: none;
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.2s;
}

.category-filter a:hover {
    color: var(--primary-color);
    padding-right: 0.5rem;
}

.category-count {
    background: #f3f4f6;
    color: #6b7280;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

.category-filter a:hover .category-count {
    background: var(--primary-color);
    color: white;
}

/* Color Filter */
.color-filter {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.color-option {
    position: relative;
}

.color-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.color-option label {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
}

.color-option input[type="checkbox"]:checked + label {
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.color-option input[type="checkbox"]:checked + label::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 1rem;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

/* Size Filter */
.size-filter {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.size-option {
    position: relative;
}

.size-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.size-option label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    background: white;
}

.size-option input[type="checkbox"]:checked + label {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.size-option label:hover {
    border-color: var(--primary-color);
}

/* ==========================================================================
   Loading Components
   ========================================================================== */

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f4f6;
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out 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);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    text-align: center;
}

.loading-spinner p {
    margin-top: 1rem;
    color: #6b7280;
}

/* ==========================================================================
   Toast Notification Components
   ========================================================================== */

.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-left: 4px solid var(--primary-color);
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 350px;
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-notification.success {
    border-left-color: var(--success-color);
}

.toast-notification.error {
    border-left-color: var(--error-color);
}

.toast-notification.warning {
    border-left-color: var(--warning-color);
}

.toast-notification.info {
    border-left-color: var(--info-color);
}

.toast-content {
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-notification.success .toast-icon {
    color: var(--success-color);
}

.toast-notification.error .toast-icon {
    color: var(--error-color);
}

.toast-notification.warning .toast-icon {
    color: var(--warning-color);
}

.toast-notification.info .toast-icon {
    color: var(--info-color);
}

.toast-message {
    flex: 1;
}

.toast-message h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
}

.toast-message p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 0;
    font-size: 1rem;
    flex-shrink: 0;
}

.toast-close:hover {
    color: #6b7280;
}

/* ==========================================================================
   Pagination Components
   ========================================================================== */

.pagination-wrapper {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    margin: 0 2px;
    border: 1px solid #e5e7eb;
    background: white;
    color: #6b7280;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.page-numbers:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(236, 72, 153, 0.05);
}

.page-numbers.current {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-numbers.prev,
.page-numbers.next {
    font-weight: 600;
}

.page-numbers.prev:hover,
.page-numbers.next:hover {
    background: var(--primary-color);
    color: white;
}

/* ==========================================================================
   Breadcrumb Components
   ========================================================================== */

.breadcrumb-nav {
    background: #f8fafc;
    padding: 1rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: '/';
    margin: 0 0.5rem;
    color: #d1d5db;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .active {
    color: #374151;
    font-weight: 500;
}

/* ==========================================================================
   Widget Custom Styles
   ========================================================================== */

/* Recent Posts Widget */
.recent-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-post-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

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

.recent-post-item a {
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    line-height: 1.4;
    display: block;
    margin-bottom: 0.25rem;
}

.recent-post-item a:hover {
    color: var(--primary-color);
}

.recent-post-date {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Categories Widget */
.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    margin-bottom: 0.5rem;
}

.category-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    color: #6b7280;
    text-decoration: none;
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.2s;
}

.category-item a:hover {
    color: var(--primary-color);
    padding-right: 0.5rem;
}

.category-item .count {
    background: #f3f4f6;
    color: #6b7280;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Tags Widget */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-link {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: #f3f4f6;
    color: #6b7280;
    text-decoration: none;
    border-radius: 15px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

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

/* ==========================================================================
   Animation Classes
   ========================================================================== */

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

.bounce-in {
    animation: bounceIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }

.hidden { display: none !important; }
.visible { display: block !important; }

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