/**
 * Home Fit Styles
 */

.home-fit-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Info Section */
.home-fit-info {
    background: #f7f7f7;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 30px;
}

.home-fit-info h3 {
    margin: 0 0 15px;
    font-size: 1.4em;
    color: #333;
}

.home-fit-info ul {
    margin: 0;
    padding: 0 0 0 20px;
}

.home-fit-info li {
    margin-bottom: 10px;
    line-height: 1.4;
}

/* Quantity Selector */
.quantity-selector {
    margin: 20px 0;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    position: relative;
    z-index: 1;
}

/* Frame Selection Styles */
.frame-item {
    background: #fff;
    padding: 15px;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    outline: none;
}

.frame-item:hover {
    border-color: #2271b1;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.frame-item:focus {
    outline: none;
}

.frame-item:focus-visible {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.5);
    transform: translateY(-2px);
}

.frame-item.selected {
    border-color: #2271b1;
    background: #f0f6fc;
    box-shadow: 0 0 0 2px #2271b1;
}

.frame-item.selected:focus-visible {
    box-shadow: 0 0 0 2px #2271b1, 0 0 0 4px rgba(34, 113, 177, 0.5);
}

/* Cart indicator styles */
.frame-item.disabled {
    cursor: not-allowed;
    opacity: 0.7;
    pointer-events: none;
}

.frame-item.disabled:hover,
.frame-item.disabled:focus {
    transform: none;
    box-shadow: none;
}

.frame-item.in-cart {
    border: 2px dashed #2196F3;
    background: rgba(33, 150, 243, 0.05);
}

.frame-item.in-cart.selected {
    border: 2px solid #2271b1;
    background: #f0f6fc;
}

.cart-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #2196F3;
    color: white;
    padding: 4px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
}

.cart-indicator svg {
    width: 16px;
    height: 16px;
}

.frame-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    pointer-events: none;
}

.frame-item img {
    width: 100%;
    height: auto;
    border-radius: 2px;
    margin-bottom: 10px;
    pointer-events: none;
}

.frame-name {
    display: block;
    font-size: 1em;
    color: #333;
    text-align: center;
    margin-top: 10px;
    pointer-events: none;
}

/* Grid Layout */
.frames-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
    margin: 0;
}

/* Sample Lenses Option */
/* Sample Lenses Styles */
.sample-lenses-option {
    margin: 20px 0;
    padding: 15px;
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.sample-lenses-option .sample-lenses-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.sample-lenses-option .sample-lenses-image {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
}

.sample-lenses-option .sample-lenses-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sample-lenses-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    margin-bottom: 8px;
}

.sample-lenses-option input[type="checkbox"] {
    margin: 0;
}

.sample-lenses-option .description {
    margin: 0;
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
}

/* Add to Cart Button */
.single_add_to_cart_button {
    width: 100%;
    max-width: 300px;
    margin-top: 20px;
    padding: 12px 24px;
    font-size: 1.1em;
}

/* Floating Bubble */
.home-fit-floating-bubble {
    position: fixed;
    top: 100px;
    right: 20px;
    width: auto;
    background: transparent;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0px 10px 30px rgba(53, 51, 49, 0.1)) drop-shadow(0px 2.25px 6px rgba(53, 51, 49, 0.24)) drop-shadow(0.5px 2px 2px rgba(53, 51, 49, 0.18));
    cursor: pointer;
    transform-origin: bottom right;
}

/* Success notification */
.bubble-notification {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 16px 16px;
    background: #185046;
    border-radius: 12px 12px 0 0;
    position: absolute;
    width: 100%;
    font-size: 13px;
    color: #ffffff;
    top: 0;
    left: 0;
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    visibility: hidden;
    box-sizing: border-box;
}

.bubble-notification.show {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.bubble-content {
    width: 262px;
    background: #fff;
    border-radius: 12px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bubble-frame-thumbnail {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    background: #EFECEB;
    overflow: hidden;
    flex-shrink: 0;
}

.bubble-frame-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bubble-frame-info {
    margin-left: 12px;
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

p.bubble-frame-name {
    font-size: 14px;
    font-weight: 500;
    color: #231F20;
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

p.bubble-frame-type {
    font-size: 12px;
    color: #231F20;
    opacity: 0.7;
    margin: 0;
}

.bubble-collapsed {
    width: 262px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bubble-notification.show+.bubble-collapsed {
    border-radius: 12px;
}

.bubble-header {
    padding: 10px 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(35, 31, 32, 0.1);
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.bubble-header:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.bubble-header:active {
    background-color: rgba(0, 0, 0, 0.05);
}

.bubble-counter {
    position: relative;
    padding-right: 20px;
    font-size: 13px;
    color: #231F20;
    font-weight: 500;
}

/* Add indicator arrow */
.bubble-counter::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    width: 8px;
    height: 8px;
    margin-top: -6px;
    border: 2px solid #666;
    border-left: 0;
    border-top: 0;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.bubble-collapsed.expanded .bubble-counter::after {
    transform: rotate(225deg);
    margin-top: -3px;
}

.bubble-header:hover .bubble-counter::after {
    border-color: #333;
}

.bubble-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bubble-action-button {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.bubble-action-button:hover {
    opacity: 1;
}

.bubble-action-button.add-to-cart {
    color: #185046;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.bubble-action-button.add-to-cart:not(:disabled) {
    color: #00a651;
}

.bubble-action-button.add-to-cart:disabled {
    opacity: 0.3;
    color: #d63638;
    cursor: not-allowed;
    pointer-events: none;
}

.bubble-action-button.add-to-cart:not(:disabled):hover {
    opacity: 1;
    color: #008f45;
}

.bubble-action-button.remove-all {
    color: #D63638;
}

.frames-list {
    overflow-y: auto;
    padding: 0;
    margin: 0;
    flex-grow: 1;
    max-height: 50vh;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    opacity: 1;
}

.bubble-collapsed:not(.expanded) .frames-list {
    max-height: 0;
    opacity: 0;
}

.bubble-frame-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid rgba(35, 31, 32, 0.05);
}

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

/* Modal Styles */
.home-fit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.home-fit-modal.show {
    display: flex;
}

.modal-container {
    max-width: min(1200px, 80%);
    width: 90%;
    margin: auto;
    background-color: #fff;
    padding: 32px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.header-column {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
    margin-bottom: 32px;
}

.header-column>div:first-child {
    flex: 2;
}

.header-column>div:last-child {
    flex: 1;
    text-align: center;
}

.header-column h1 {
    font-size: 24px;
    margin: 0 0 16px;
    color: #231F20;
}

.header-column p {
    margin: 0;
    color: #555;
}

.checkout-button {
    display: inline-block;
    background-color: #000000;
    color: white;
    padding: 12px 32px;
    text-decoration: none;
    border-radius: 50px;
    margin-bottom: 16px;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.checkout-button:hover {
    background-color: #333;
}

.additional-info {
    font-size: 14px;
    color: #555;
    margin: 0;
}

.glasses-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 0;
}

.glass-item {
    position: relative;
    background-color: #f0f0f0;
    border-radius: 10px;
    padding: 16px;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.glass-item img {
    max-width: 100%;
    border-radius: 5px;
}

.glass-item img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 5px;
}

.glass-item p {
    margin: 16px 0 0;
    font-size: 14px;
    color: #231F20;
}

/* Cart and Checkout Styles */
.woocommerce-cart .variation dd[class^="variation-Set"],
.woocommerce-checkout .variation dd[class^="variation-Set"],
.woocommerce-cart .variation dd[class^="variation-SampleLenses"],
.woocommerce-checkout .variation dd[class^="variation-SampleLenses"] {
    margin: 0;
    padding: 0;
}

.woocommerce-cart .variation dd[class^="variation-Set"] p,
.woocommerce-checkout .variation dd[class^="variation-Set"] p,
.woocommerce-cart .variation dd[class^="variation-SampleLenses"] p,
.woocommerce-checkout .variation dd[class^="variation-SampleLenses"] p {
    font-size: 13px !important;
    margin: 0 0 5px !important;
    line-height: 1.4;
}

.woocommerce-cart .variation dt[class^="variation-Set"],
.woocommerce-checkout .variation dt[class^="variation-Set"],
.woocommerce-cart .variation dt[class^="variation-SampleLenses"],
.woocommerce-checkout .variation dt[class^="variation-SampleLenses"] {
    font-size: 14px !important;
    font-weight: 500;
    margin: 0 0 5px !important;
    line-height: 1.4;
}

.woocommerce-cart .home-fit-set-items,
.woocommerce-checkout .home-fit-set-items {
    margin-top: 10px;
    padding-left: 15px;
    border-left: 2px solid #f0f0f0;
}

.woocommerce-cart .home-fit-set-item,
.woocommerce-checkout .home-fit-set-item {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

/* Order Review Styles */
.woocommerce-checkout #order_review .variation dd[class^="variation-Set"] {
    background: #f7f7f7;
    padding: 10px;
    border-radius: 4px;
    margin-top: 5px;
}

@media (max-width: 768px) {
    .header-column {
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }

    .header-column>div:first-child,
    .header-column>div:last-child {
        flex: 1;
    }

    .frames-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 20px;
    }

    .home-fit-floating-bubble {
        position: fixed;
        bottom: auto;
        top: 60px;
        left: 0;
        right: 0;
        width: 100%;
        padding: 0 20px;
        box-sizing: border-box;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .bubble-collapsed {
        width: 100%;
        position: relative;
        max-height: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 12px;
    }

    .bubble-notification.show+.bubble-collapsed {
        border-radius: 12px;
    }

    .bubble-collapsed.expanded {
        width: 100%;
        max-width: none;
        margin: 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    .frames-list {
        max-height: calc(60vh - 120px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .bubble-notification {
        position: absolute;
        margin: 0;
        top: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .bubble-content {
        width: 100%;
    }

    .glasses-container {
        grid-template-columns: repeat(2, 1fr);
    }
}