/**
 * RichPearls Variation Swatches & Size Guide Frontend Styles
 * Tailored for Women's Attire & Boutique Experience
 */

/* ==========================================================================
   Swatch Container & Grouping
   ========================================================================== */
.richpearls-swatches-container {
    margin: 8px 0 16px;
    clear: both;
}

.richpearls-swatches-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 6px 0;
}

/* ==========================================================================
   Base Swatch Item Button
   ========================================================================== */
.rp-swatch-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    cursor: pointer;
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
}

/* ==========================================================================
   Color Swatches
   ========================================================================== */
.rp-type-color .rp-swatch-item {
    padding: 2px;
    border: 1.5px solid transparent;
}

.rp-type-color.rp-size-small .rp-swatch-item { width: 28px; height: 28px; }
.rp-type-color.rp-size-medium .rp-swatch-item { width: 36px; height: 36px; }
.rp-type-color.rp-size-large .rp-swatch-item { width: 44px; height: 44px; }

.rp-swatch-color-fill {
    display: block;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

/* Shapes for Colors */
.rp-shape-circle.rp-type-color .rp-swatch-item,
.rp-shape-circle .rp-swatch-color-fill {
    border-radius: 50%;
}

.rp-shape-rounded.rp-type-color .rp-swatch-item,
.rp-shape-rounded .rp-swatch-color-fill {
    border-radius: 8px;
}

.rp-shape-square.rp-type-color .rp-swatch-item,
.rp-shape-square .rp-swatch-color-fill {
    border-radius: 2px;
}

/* Light color outline protection */
.rp-swatch-item.rp-light-color .rp-swatch-color-fill {
    box-shadow: inset 0 0 0 1px #d1d5db;
}

/* Color Hover & Active States */
.rp-type-color .rp-swatch-item:hover .rp-swatch-color-fill {
    transform: scale(1.08);
}

.rp-type-color .rp-swatch-item.rp-selected {
    border-color: #111111 !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #111111 !important;
}

.rp-type-color .rp-swatch-item.rp-selected .rp-swatch-color-fill {
    transform: scale(0.85);
}

/* ==========================================================================
   Size & Button Pill Swatches
   ========================================================================== */
.rp-type-button .rp-swatch-item {
    min-width: 44px;
    height: 38px;
    padding: 0 14px;
    background-color: #ffffff;
    border: 1.5px solid #d1d5db;
    color: #1f2937;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.3px;
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.rp-swatch-item * {
    pointer-events: none !important;
}

/* Shapes for Buttons */
.rp-shape-circle.rp-type-button .rp-swatch-item {
    border-radius: 9999px; /* Pill */
}
.rp-shape-rounded.rp-type-button .rp-swatch-item {
    border-radius: 6px;
}
.rp-shape-square.rp-type-button .rp-swatch-item {
    border-radius: 0px;
}

.rp-type-button.rp-size-small .rp-swatch-item {
    min-width: 36px;
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
}

.rp-type-button.rp-size-large .rp-swatch-item {
    min-width: 52px;
    height: 44px;
    padding: 0 18px;
    font-size: 15px;
}

/* Button Hover & Active States */
.rp-type-button .rp-swatch-item:hover {
    border-color: #111111;
    color: #111111;
    background-color: #f9fafb;
}

.rp-type-button .rp-swatch-item.rp-selected {
    background-color: #111111 !important;
    border-color: #111111 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15) !important;
}

/* Size Price Difference Badges */
.rp-size-price-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.1;
    color: #047857;
    background: #ecfdf5;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #a7f3d0;
    letter-spacing: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.rp-type-button .rp-swatch-item.rp-selected .rp-size-price-tag {
    background: #059669 !important;
    color: #ffffff !important;
    border-color: #34d399 !important;
}

.rp-type-button .rp-swatch-item:hover .rp-size-price-tag {
    border-color: #059669;
}

/* ==========================================================================
   Image Swatches
   ========================================================================== */
.rp-type-image .rp-swatch-item {
    width: 44px;
    height: 44px;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    padding: 1px;
}

.rp-swatch-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rp-type-image .rp-swatch-item.rp-selected {
    border-color: #111111;
    outline: 1.5px solid #111111;
}

/* ==========================================================================
   Out of Stock / Disabled Variations
   ========================================================================== */
/* Diagonal Slash (Cross-out) */
.rp-swatch-item.rp-out-of-stock {
    opacity: 0.55;
    cursor: not-allowed;
}

.rp-swatch-item.rp-out-of-stock::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -15%;
    width: 130%;
    height: 1.5px;
    background-color: #ef4444;
    transform: rotate(-45deg);
    pointer-events: none;
    z-index: 2;
}

.rp-swatch-item.rp-out-of-stock:hover {
    transform: none !important;
}

/* Blur mode */
.rp-oos-blur .rp-swatch-item.rp-out-of-stock {
    opacity: 0.3;
    filter: grayscale(100%);
}
.rp-oos-blur .rp-swatch-item.rp-out-of-stock::after {
    display: none;
}

/* Hide mode */
.rp-oos-hide .rp-swatch-item.rp-out-of-stock {
    display: none !important;
}

/* ==========================================================================
   Tooltips
   ========================================================================== */
.rp-swatch-tooltip {
    position: absolute;
    bottom: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background-color: #1f2937;
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.rp-swatch-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}

.rp-swatch-item:hover .rp-swatch-tooltip,
.rp-swatch-item:focus-visible .rp-swatch-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Size Guide Trigger Button
   ========================================================================== */
.rp-size-guide-trigger-wrap {
    display: inline-block;
    margin-bottom: 6px;
    float: right;
}

.rp-size-guide-trigger {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
}

.rp-size-guide-trigger:hover {
    color: #b45309;
}

/* ==========================================================================
   Size Guide Modal Dialog
   ========================================================================== */
.rp-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.rp-modal.rp-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.rp-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    animation: rpFadeIn 0.2s ease;
}

.rp-modal-dialog {
    position: relative;
    width: 92%;
    max-width: 780px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 1;
    animation: rpScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.rp-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #f1f5f9;
    background-color: #fafaf9;
}

.rp-modal-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rp-modal-icon {
    font-size: 20px;
}

.rp-modal-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.2px;
}

.rp-modal-close {
    background: transparent;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.rp-modal-close:hover {
    color: #0f172a;
    background-color: #e2e8f0;
}

.rp-modal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 24px;
    background-color: #ffffff;
    border-bottom: 1px solid #f1f5f9;
}

.rp-chart-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.rp-tab-btn {
    background: #f1f5f9;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.rp-tab-btn:hover {
    background-color: #e2e8f0;
    color: #0f172a;
}

.rp-tab-btn.rp-active {
    background-color: #1e293b;
    color: #ffffff;
    font-weight: 600;
}

.rp-unit-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.rp-unit-toggle {
    display: inline-flex;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 2px;
}

.rp-unit-btn {
    background: transparent;
    border: none;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.rp-unit-btn.rp-active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.rp-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    max-height: 60vh;
}

.rp-chart-pane {
    display: none;
}

.rp-chart-pane.rp-active {
    display: block;
}

.rp-chart-desc {
    margin: 0 0 14px;
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.5;
}

.rp-table-responsive {
    overflow-x: auto;
    border: 2px solid #1e293b;
    border-radius: 4px;
    background: #ffffff;
}

.rp-size-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
    text-align: center;
}

.rp-table-title-cell {
    background-color: #ffffff;
    color: #000000;
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 12px 14px;
    border-bottom: 2px solid #1e293b !important;
    text-align: center;
}

.rp-size-table th {
    background-color: #ffffff;
    color: #000000;
    font-weight: 700;
    font-size: 14.5px;
    padding: 11px 14px;
    border: 1px solid #1e293b;
    white-space: nowrap;
    text-align: center;
}

.rp-size-table td {
    padding: 11px 14px;
    border: 1px solid #1e293b;
    color: #000000;
    font-size: 14.5px;
    font-weight: 500;
    text-align: center;
}

.rp-size-table tr:last-child td {
    border-bottom: 1px solid #1e293b;
}

.rp-size-table tr:hover td {
    background-color: #f8fafc;
}

.rp-size-table td.rp-size-col {
    font-weight: 700;
    color: #000000;
    background-color: #ffffff;
    text-align: left;
    white-space: nowrap;
    padding-left: 14px;
}

.rp-measuring-tips {
    margin-top: 20px;
    padding: 14px 18px;
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
}

.rp-tips-title {
    margin: 0 0 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: #92400e;
}

.rp-tips-list {
    margin: 0;
    padding-left: 18px;
    font-size: 12.5px;
    color: #78350f;
    line-height: 1.6;
}

.rp-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 24px;
    background-color: #fafaf9;
    border-top: 1px solid #f1f5f9;
}

.rp-footer-note {
    font-size: 12px;
    color: #64748b;
}

.rp-btn-got-it {
    background-color: #1e293b;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.rp-btn-got-it:hover {
    background-color: #0f172a;
}

/* Animations */
@keyframes rpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes rpScaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   Catalog / Shop Loop Swatches
   ========================================================================== */
.rp-catalog-swatches-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 8px 0;
    flex-wrap: wrap;
}

.rp-catalog-swatch {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: transform 0.15s ease;
}

.rp-shape-circle .rp-catalog-swatch { border-radius: 50%; }
.rp-shape-rounded .rp-catalog-swatch { border-radius: 4px; }
.rp-shape-square .rp-catalog-swatch { border-radius: 0; }

.rp-catalog-swatch:hover {
    transform: scale(1.18);
    border-color: #111;
}

.rp-catalog-more-badge {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 5px;
    border-radius: 10px;
    text-decoration: none;
}

.rp-catalog-more-badge:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Responsive */
@media (max-width: 600px) {
    .rp-modal-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .rp-modal-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .rp-btn-got-it {
        text-align: center;
    }
}

/* ==========================================================================
   Remove Floating Sticky Add to Cart & Options on Mobile View
   ========================================================================== */
@media (max-width: 767px) {
    #glozin-sticky-add-to-cart,
    .glozin-sticky-add-to-cart {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
        opacity: 0 !important;
        transform: translateY(200%) !important;
        height: 0 !important;
        overflow: hidden !important;
    }
    body.glozin-atc-sticky-height-open,
    body {
        --gz-atc-sticky-height: 0px !important;
        padding-bottom: 0 !important;
    }
}

/* Ensure Color/Size Swatches never render or clutter any sticky bar */
.glozin-sticky-add-to-cart .rp-simple-swatches-wrapper,
.glozin-sticky-add-to-cart .richpearls-swatches-container,
.glozin-sticky-add-to-cart .rp-size-guide-trigger,
.glozin-sticky-add-to-cart .rp-simple-attr-group,
.glozin-sticky-add-to-cart .rp-product-video-wrap {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* ==========================================================================
   Product Video Button & Popup Player
   ========================================================================== */
.rp-product-video-wrap {
    margin: 14px 0 16px;
    display: block;
}

.rp-product-video-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 18px;
    background: #ffffff;
    border: 1.5px solid #d4af37; /* Rich boutique warm gold */
    color: #1e293b;
    border-radius: 50px;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.15);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.rp-product-video-btn:hover,
.rp-product-video-btn:focus {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
    transform: translateY(-1.5px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
}

.rp-video-btn-play-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: #d4af37;
    color: #ffffff;
    border-radius: 50%;
    flex-shrink: 0;
    transition: transform 0.25s ease, background-color 0.25s ease;
}

.rp-video-btn-play-icon svg {
    margin-left: 2px; /* Visual center for triangle play icon */
}

.rp-product-video-btn:hover .rp-video-btn-play-icon {
    transform: scale(1.1);
    background: #eab308;
}

.rp-video-btn-text {
    font-family: inherit;
    letter-spacing: 0.2px;
}

.rp-video-btn-badge {
    display: inline-block;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 4px;
    text-transform: uppercase;
    transition: background 0.2s ease, color 0.2s ease;
}

.rp-product-video-btn:hover .rp-video-btn-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #f8fafc;
}

/* Video Modal Dialog */
.rp-video-modal-dialog {
    max-width: 860px;
    width: 94%;
    background: #000000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.rp-video-modal-dialog.rp-vertical-video {
    max-width: 440px; /* Perfect for 9:16 vertical shorts/reels */
}

.rp-video-modal-header {
    background: #0f172a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 20px;
}

.rp-video-modal-header .rp-modal-title {
    color: #f8fafc;
    font-size: 15px;
    font-weight: 600;
}

.rp-video-modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #f8fafc;
    font-size: 22px;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rp-video-modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    transform: rotate(90deg);
}

.rp-video-modal-body {
    padding: 0;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rp-video-player-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    background: #000000;
}

.rp-vertical-video .rp-video-player-container {
    padding-bottom: 177.77%; /* 9:16 Vertical Ratio */
}

.rp-video-player-target {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.rp-video-player-target iframe,
.rp-video-player-target video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 600px) {
    .rp-product-video-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    .rp-video-modal-dialog {
        width: 96%;
        border-radius: 12px;
    }
}

