/**
 * RB Jewellers Catalog - Components Styles
 *
 * @package    RB_Jewellers_Catalog
 * @since      2.0.0
 */

/* ==========================================================================
   Loading State
   ========================================================================== */

.rb-loading {
    text-align: center;
    padding: 40px;
}

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

.rb-spinner-small {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

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


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

.rb-pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.rb-page-numbers {
    display: flex;
    gap: 5px;
}

.rb-page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--rb-bg);
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius-sm);
    font-size: 14px;
    color: var(--rb-text);
    cursor: pointer;
    transition: all var(--rb-transition);
}

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

.rb-page-btn.active {
    background: var(--rb-primary);
    border-color: var(--rb-primary);
    color: var(--rb-bg);
}

.rb-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rb-load-more {
    padding: 12px 40px;
    background: var(--rb-bg);
    border: 2px solid var(--rb-primary);
    border-radius: var(--rb-radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--rb-primary);
    cursor: pointer;
    transition: all var(--rb-transition);
}

.rb-load-more:hover {
    background: var(--rb-primary);
    color: var(--rb-bg);
}


/* ==========================================================================
   No Products
   ========================================================================== */

.rb-no-products {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

.rb-no-products-icon {
    font-size: 48px;
    color: var(--rb-text-muted);
    margin-bottom: 15px;
}

.rb-no-products h3 {
    margin: 0 0 10px;
    font-size: 20px;
    color: var(--rb-text);
}

.rb-no-products p {
    margin: 0 0 20px;
    color: var(--rb-text-light);
}


/* ==========================================================================
   CONSOLIDATED BUTTON SYSTEM
   Uses design tokens from variables.css
   ========================================================================== */

/* Base Button */
.rb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--rb-space-3);
    height: var(--rb-button-height-md);
    padding: 0 var(--rb-button-padding-x-md);
    font-family: var(--rb-font-family-sans);
    font-size: var(--rb-font-size-base);
    font-weight: var(--rb-font-weight-semibold);
    line-height: var(--rb-line-height-none);
    text-decoration: none;
    white-space: nowrap;
    border: none;
    border-radius: var(--rb-radius-lg);
    cursor: pointer;
    user-select: none;
    transition: var(--rb-transition-base);
}

.rb-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Size Modifiers */
.rb-btn-sm {
    height: var(--rb-button-height-sm);
    padding: 0 var(--rb-button-padding-x-sm);
    font-size: var(--rb-font-size-sm);
    gap: var(--rb-space-2);
}

.rb-btn-lg {
    height: var(--rb-button-height-lg);
    padding: 0 var(--rb-button-padding-x-lg);
    font-size: var(--rb-font-size-lg);
    gap: var(--rb-space-4);
}

/* Style Variants */
.rb-btn-primary {
    background: var(--rb-color-primary);
    color: var(--rb-color-white);
    box-shadow: var(--rb-shadow-sm);
}

.rb-btn-primary:hover:not(:disabled) {
    background: var(--rb-color-primary-700);
    box-shadow: var(--rb-shadow-md);
}

.rb-btn-primary:active:not(:disabled) {
    background: var(--rb-color-primary-800);
    box-shadow: var(--rb-shadow-sm);
}

.rb-btn-primary:focus-visible {
    outline: none;
    box-shadow: var(--rb-shadow-focus), var(--rb-shadow-md);
}

.rb-btn-secondary {
    background: var(--rb-color-secondary);
    color: var(--rb-color-white);
    box-shadow: var(--rb-shadow-sm);
}

.rb-btn-secondary:hover:not(:disabled) {
    background: var(--rb-color-secondary-700);
    box-shadow: var(--rb-shadow-md);
}

.rb-btn-secondary:active:not(:disabled) {
    background: var(--rb-color-secondary-800);
    box-shadow: var(--rb-shadow-sm);
}

.rb-btn-outline {
    background: transparent;
    color: var(--rb-color-text-primary);
    border: 2px solid var(--rb-color-border);
    box-shadow: none;
}

.rb-btn-outline:hover:not(:disabled) {
    border-color: var(--rb-color-primary);
    color: var(--rb-color-primary);
    background: var(--rb-color-primary-50);
}

.rb-btn-outline:active:not(:disabled) {
    background: var(--rb-color-primary-100);
}

/* Special Purpose Buttons */
.rb-send-whatsapp {
    background: var(--rb-whatsapp);
}

.rb-send-whatsapp:hover {
    background: #1da851;
}

.rb-submit-btn {
    width: 100%;
}


/* ==========================================================================
   Icons (using CSS shapes/unicode)
   ========================================================================== */

.rb-icon-filter::before { content: "\2630"; }
.rb-icon-close::before { content: "\00D7"; }
.rb-icon-search::before { content: "\1F50D"; }
.rb-icon-eye::before { content: "\1F441"; }
.rb-icon-plus::before { content: "+"; }
.rb-icon-cart::before { content: "\1F6D2"; }
.rb-icon-whatsapp::before { content: "\1F4AC"; }
.rb-icon-email::before { content: "\2709"; }
.rb-icon-check::before { content: "\2713"; }
.rb-icon-chevron::before { content: "\276F"; }
.rb-icon-chevron-left::before { content: "\276E"; }
.rb-icon-chevron-right::before { content: "\276F"; }


/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.rb-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--rb-space-2);
    margin-bottom: var(--rb-space-5);
    font-size: var(--rb-font-size-sm);
    color: var(--rb-text-light);
}

.rb-breadcrumbs a {
    color: var(--rb-text-light);
    text-decoration: none;
    transition: var(--rb-transition-fast);
}

.rb-breadcrumbs a:hover {
    color: var(--rb-primary);
    text-decoration: underline;
}

.rb-breadcrumb-separator {
    color: var(--rb-text-muted);
    user-select: none;
}

.rb-breadcrumb-current {
    color: var(--rb-text);
    font-weight: var(--rb-font-weight-medium);
}


/* ==========================================================================
   Page Header
   ========================================================================== */

.rb-catalog-header,
.rb-page-header {
    margin-bottom: 30px;
    text-align: center;
}

.rb-catalog-title,
.rb-page-title {
    margin: 0 0 10px;
    font-size: 32px;
    font-weight: 600;
    color: var(--rb-secondary);
}

.rb-catalog-description,
.rb-page-description {
    margin: 0;
    font-size: 16px;
    color: var(--rb-text-light);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Category Banner */
.rb-category-banner {
    position: relative;
    height: 250px;
    border-radius: var(--rb-radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
    background-size: cover;
    background-position: center;
}

.rb-category-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.6));
}

.rb-category-banner-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    padding: 20px;
}

.rb-category-banner .rb-catalog-title {
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.rb-category-banner .rb-catalog-description {
    color: rgba(255,255,255,0.9);
}


/* ==========================================================================
   Pagination Enhancement
   ========================================================================== */

.rb-pagination .page-numbers {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 0;
    padding: 0;
}

.rb-pagination .page-numbers li {
    margin: 0;
}

.rb-pagination .page-numbers a,
.rb-pagination .page-numbers span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--rb-bg);
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius-sm);
    font-size: 14px;
    color: var(--rb-text);
    transition: all var(--rb-transition);
}

.rb-pagination .page-numbers a:hover {
    border-color: var(--rb-primary);
    color: var(--rb-primary);
}

.rb-pagination .page-numbers .current {
    background: var(--rb-primary);
    border-color: var(--rb-primary);
    color: #fff;
}


/* ==========================================================================
   Notification System
   ========================================================================== */

.rb-notification {
    position: fixed;
    top: var(--rb-space-6);
    right: var(--rb-space-6);
    min-width: 320px;
    max-width: 480px;
    background: var(--rb-color-white);
    border-radius: var(--rb-radius-xl);
    box-shadow: var(--rb-shadow-xl);
    z-index: var(--rb-z-tooltip);
    animation: rb-notification-slide-in 0.3s var(--rb-ease-out);
}

@keyframes rb-notification-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.rb-notification-hiding {
    animation: rb-notification-slide-out 0.3s var(--rb-ease-in);
}

@keyframes rb-notification-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.rb-notification-content {
    display: flex;
    align-items: center;
    gap: var(--rb-space-3);
    padding: var(--rb-space-4) var(--rb-space-5);
}

.rb-notification-icon {
    font-size: var(--rb-font-size-2xl);
    flex-shrink: 0;
}

.rb-notification-message {
    flex: 1;
    font-size: var(--rb-font-size-sm);
    font-weight: var(--rb-font-weight-medium);
    color: var(--rb-color-text-primary);
    line-height: var(--rb-line-height-normal);
}

.rb-notification-close {
    width: var(--rb-space-6);
    height: var(--rb-space-6);
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--rb-radius-md);
    font-size: var(--rb-font-size-xl);
    color: var(--rb-color-text-tertiary);
    cursor: pointer;
    transition: var(--rb-transition-fast);
    flex-shrink: 0;
}

.rb-notification-close:hover {
    background: var(--rb-color-bg-secondary);
    color: var(--rb-color-text-primary);
}

.rb-notification-retry {
    height: var(--rb-button-height-sm);
    padding: 0 var(--rb-space-3);
    background: var(--rb-color-primary);
    color: var(--rb-color-white);
    border: none;
    border-radius: var(--rb-radius-md);
    font-size: var(--rb-font-size-sm);
    font-weight: var(--rb-font-weight-semibold);
    cursor: pointer;
    transition: var(--rb-transition-fast);
    flex-shrink: 0;
}

.rb-notification-retry:hover {
    background: var(--rb-color-primary-700);
}

/* Success Notification */
.rb-notification-success {
    border-left: 4px solid var(--rb-color-success);
}

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

/* Error Notification */
.rb-notification-error {
    border-left: 4px solid var(--rb-color-error);
}

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

/* Loading Notification */
.rb-notification-loading {
    border-left: 4px solid var(--rb-color-primary);
}

.rb-notification-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--rb-color-gray-200);
    border-top-color: var(--rb-color-primary);
    border-radius: var(--rb-radius-full);
    animation: rb-spinner-rotate 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes rb-spinner-rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .rb-notification {
        top: var(--rb-space-4);
        right: var(--rb-space-4);
        left: var(--rb-space-4);
        min-width: auto;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .rb-notification-content {
        padding: var(--rb-space-3) var(--rb-space-4);
        gap: var(--rb-space-2);
    }

    .rb-notification-icon {
        font-size: var(--rb-font-size-xl);
    }

    .rb-notification-message {
        font-size: var(--rb-font-size-xs);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .rb-notification {
        animation: none;
    }

    .rb-notification-hiding {
        animation: none;
        opacity: 0;
    }

    .rb-notification-spinner {
        animation: none;
        border-top-color: var(--rb-color-primary);
    }
}

