/* ==========================================================
   CurtainXPRESS - Dropdown Collapsible & 70x70 Fabric Swatches
========================================================== */

/* Toggle Button Area */
.cxp-swatch-toggle-wrapper {
    margin: 18px 0 10px !important;
    display: block !important;
}

.cxp-swatch-toggle-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 12px 16px !important;
    background: #FFFFFF !important;
    color: #111827 !important;
    border: 1.5px solid #111827 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
}

.cxp-swatch-toggle-btn:hover {
    background: #111827 !important;
    color: #FFFFFF !important;
}

.cxp-swatch-toggle-btn:hover .cxp-toggle-pill {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #FFFFFF !important;
    border-color: transparent !important;
}

.cxp-toggle-left {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.cxp-toggle-icon {
    font-size: 15px !important;
}

.cxp-toggle-text {
    font-size: 12.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
}

.cxp-toggle-right {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.cxp-toggle-pill {
    font-size: 10.5px !important;
    font-weight: 700 !important;
    padding: 2px 8px !important;
    background: #F3F4F6 !important;
    border: 1px solid #E5E7EB !important;
    border-radius: 12px !important;
    color: #1F2937 !important;
    transition: all 0.2s ease !important;
}

.cxp-toggle-arrow {
    font-size: 12px !important;
    transition: transform 0.25s ease !important;
    display: inline-block !important;
}

.cxp-swatch-toggle-btn.is-active .cxp-toggle-arrow {
    transform: rotate(180deg) !important;
}

/* Collapsible Main Container */
.cxp-product-swatch-order,
.cxp-product-swatch-wrapper {
    margin: 10px 0 24px !important;
    padding: 16px !important;
    border: 1.5px solid #E5E7EB !important;
    border-radius: 8px !important;
    background: #FFFFFF !important;
    box-sizing: border-box !important;
}

/* Tabs */
.cxp-product-swatch-tabs,
.cxp-swatch-tabs {
    display: flex !important;
    gap: 16px !important;
    border-bottom: 1px solid #E5E7EB !important;
    margin-bottom: 14px !important;
}

.cxp-product-swatch-tab,
.cxp-swatch-tab-btn {
    padding: 0 0 8px !important;
    border: none !important;
    background: transparent !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    color: #6B7280 !important;
    border-bottom: 2px solid transparent !important;
    cursor: pointer !important;
}

.cxp-product-swatch-tab.is-active,
.cxp-swatch-tab-btn.active {
    color: #111827 !important;
    border-bottom-color: #111827 !important;
}

/* Reduced Header Size */
.cxp-inline-swatch-heading,
.cxp-inline-swatch-header {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 10px !important;
    margin-bottom: 12px !important;
}

.cxp-header-text h3,
.cxp-swatch-heading {
    margin: 0 0 2px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    line-height: 1.2 !important;
}

.cxp-header-text p,
.cxp-swatch-subheading {
    margin: 0 !important;
    font-size: 11.5px !important;
    color: #6B7280 !important;
}

.cxp-inline-swatch-badge,
.cxp-swatch-badge {
    font-size: 10.5px !important;
    font-weight: 700 !important;
    padding: 3px 8px !important;
    background: #F3F4F6 !important;
    border: 1px solid #E5E7EB !important;
    border-radius: 20px !important;
    color: #1F2937 !important;
    white-space: nowrap !important;
}

/* 70px x 70px Swatch Tiles */
.cxp-inline-swatch-grid,
.cxp-fabric-swatch-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
}

.cxp-swatch-card,
.cxp-fabric-swatch-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 78px !important;
    padding: 3px !important;
    background: #FFFFFF !important;
    border: 1.5px solid #E5E7EB !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    text-align: center !important;
    box-sizing: border-box !important;
    transition: all 0.15s ease !important;
}

.cxp-swatch-card:hover,
.cxp-fabric-swatch-card:hover {
    border-color: #9CA3AF !important;
    transform: translateY(-1px) !important;
}

.cxp-swatch-card.is-selected,
.cxp-fabric-swatch-card.is-selected {
    border-color: #111827 !important;
    box-shadow: 0 0 0 1px #111827 !important;
    background: #FAFAFA !important;
}

.cxp-swatch-image-wrap,
.cxp-swatch-thumb-box {
    position: relative !important;
    width: 70px !important;
    height: 70px !important;
    flex: 0 0 70px !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    background: #F3F4F6 !important;
}

.cxp-swatch-image-wrap img,
.cxp-swatch-thumb-box img {
    width: 70px !important;
    height: 70px !important;
    max-width: 70px !important;
    max-height: 70px !important;
    object-fit: cover !important;
    display: block !important;
}

.cxp-swatch-check {
    position: absolute !important;
    top: 4px !important;
    right: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 18px !important;
    height: 18px !important;
    background: #111827 !important;
    color: #FFFFFF !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    opacity: 0 !important;
    border-radius: 50% !important;
    transition: opacity 0.15s ease !important;
}

.cxp-swatch-card.is-selected .cxp-swatch-check,
.cxp-fabric-swatch-card.is-selected .cxp-swatch-check {
    opacity: 1 !important;
}

.cxp-swatch-name,
.cxp-swatch-name-text {
    display: block !important;
    width: 100% !important;
    margin-top: 4px !important;
    font-size: 10.5px !important;
    font-weight: 600 !important;
    color: #1F2937 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.2 !important;
}

/* Force-Hide Any Legacy Elements */
.cxp-swatch-card .cxp-swatch-price,
.cxp-fabric-swatch-card span:nth-child(3),
.cxp-swatch-summary-card,
.cxp-summary-row,
.cxp-inline-summary-main,
.cxp-inline-summary-lines,
.cxp-inline-selected-swatches,
.cxp-selected-swatches,
#cxp-inline-selected-swatches {
    display: none !important;
}

/* Action & Status Row */
.cxp-swatch-action-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding-top: 12px !important;
    border-top: 1px solid #E5E7EB !important;
}

.cxp-swatch-pricing-status {
    display: flex !important;
    flex-direction: column !important;
    gap: 1px !important;
}

.cxp-status-line {
    font-size: 13px !important;
    color: #1F2937 !important;
}

.cxp-status-line strong {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin-left: 3px !important;
}

.cxp-status-sub {
    font-size: 10.5px !important;
    color: #6B7280 !important;
}

/* Add to Cart Button */
.cxp-swatch-order-button,
.cxp-btn-add-swatches {
    height: 42px !important;
    padding: 0 20px !important;
    border: none !important;
    border-radius: 6px !important;
    background: #111827 !important;
    color: #FFFFFF !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.cxp-swatch-order-button:hover:not(:disabled),
.cxp-btn-add-swatches:hover:not(:disabled) {
    background: #000000 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.cxp-swatch-order-button:disabled,
.cxp-btn-add-swatches:disabled {
    opacity: 0.35 !important;
    cursor: not-allowed !important;
    background: #6B7280 !important;
}

.cxp-swatch-footer-note,
.cxp-swatch-disclaimer {
    margin: 10px 0 0 !important;
    font-size: 11px !important;
    color: #9CA3AF !important;
}

.cxp-swatch-message {
    font-size: 11.5px !important;
    margin-top: 6px !important;
}

.cxp-swatch-message.is-error {
    color: #DC2626 !important;
}

.cxp-swatch-message.is-success {
    color: #16A34A !important;
}

/* Info Tab */
.cxp-free-swatch-info {
    padding: 14px !important;
    background: #F9FAFB !important;
    border-radius: 6px !important;
}

.cxp-free-swatch-info h4 {
    margin: 0 0 4px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

.cxp-free-swatch-info p {
    margin: 0 0 10px !important;
    font-size: 11.5px !important;
    color: #4B5563 !important;
}

.cxp-info-metrics {
    display: flex !important;
    gap: 10px !important;
}

.cxp-info-metrics > div {
    flex: 1 !important;
    background: #FFFFFF !important;
    padding: 10px !important;
    border-radius: 6px !important;
    border: 1px solid #E5E7EB !important;
    text-align: center !important;
}

.cxp-info-metrics strong {
    display: block !important;
    font-size: 14px !important;
    color: #8B5E3C !important;
}

.cxp-info-metrics span {
    font-size: 10.5px !important;
    color: #6B7280 !important;
}

@media (max-width: 480px) {
    .cxp-swatch-action-row {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .cxp-swatch-order-button,
    .cxp-btn-add-swatches {
        width: 100% !important;
        height: 44px !important;
    }
}