
html,
body {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Prevent layout shift on product selection */
.product-selection-form {
    contain: layout;
}

.product-selection-form .row {
    contain: layout;
}

/* Prevent layout shift on paste selection (step 2) */
.paste-selection-form {
    contain: layout;
}

.paste-selection-form .row {
    contain: layout;
}

/* Prevent automatic scrolling to radio inputs */
input[type="radio"] {
    scroll-margin: 0 !important;
    scroll-padding: 0 !important;
}

/* Background */
body {
    background-color: #f5f5f5;
    min-height: 100vh;
}

/* Progress Bar */
.progress-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-line {
    width: 400px;
    height: 16px;
    background-color: #dee2e6;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.step-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 50%;
    background: #28a745;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Step 2 progress - full width */
.step-indicator.step-2 .step-line::after {
    width: 100%;
}

.step-text {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
    text-align: center;
}


/* Product Options */
.product-option {
    display: block;
    cursor: pointer;
    position: relative;
    /* Prevent layout shift */
    contain: layout style;
}

.product-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    /* Prevent automatic scrolling to radio inputs */
    scroll-margin: 0;
    scroll-padding: 0;
}

/* Paste Options (Step 2) */
.paste-option {
    display: block;
    cursor: pointer;
    position: relative;
    /* Prevent layout shift */
    contain: layout style;
}

.paste-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    /* Prevent automatic scrolling to radio inputs */
    scroll-margin: 0;
    scroll-padding: 0;
}

/* Product Cards */
.product-card {
    transition: outline-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
    border: none !important;
    outline: 1px solid #ababab !important;
    background-color: white !important;
    cursor: pointer;
    /* Prevent layout shift */
    box-sizing: border-box;
    will-change: outline-color, background-color;
    /* Use inset box-shadow for selection indicator without layout shift */
    box-shadow: inset 0 0 0 1px transparent;
}

/* Selection checkmark indicator */
.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-top: 35px solid #1A73E8;
    border-left: 35px solid transparent;
    z-index: 10;
    opacity: 0;
}

.product-card::after {
    content: '✓';
    font-family: inherit;
    font-weight: 700;
    position: absolute;
    top: 3px;
    right: 4px;
    color: white;
    font-size: 14px;
    z-index: 11;
    opacity: 0;
}

/* List items with hanging indent */
.product-card ul li {
    text-indent: -1.2em;
    padding-left: 1.2em;
    margin-left: 0;
}

/* Black checkmarks */
.product-card .text-success {
    color: #000 !important;
    margin-right: 0 !important;
}

/* Background color for image section */
.product-card .col-4 {
    background-color: #e0e0e0;
}

.product-card img {
    object-fit: contain;
    object-position: top;
    width: 100%;
    height: 200px;
    min-height: 200px;
    display: block;
    border-radius: 0.375rem 0 0 0.375rem;
    margin: 1px;
    width: calc(100% - 2px);
    height: calc(200px - 2px);
    min-height: calc(200px - 2px);
}

.product-card .card-body {
    padding: 1rem;
}

/* Hover state for product options */
.product-option:hover .product-card {
    outline-color: rgba(0, 0, 0, 0.4) !important;
    background-color: rgba(0, 0, 0, 0.05);
    /* Maintain consistent inset box-shadow */
    box-shadow: inset 0 0 0 1px transparent;
}

/* Selected state for product options */
.product-radio:checked + .product-card {
    outline: 2px solid #1A73E8 !important;
    background-color: rgba(26, 115, 232, 0.1);
    /* Use inset box-shadow for selection indicator */
    box-shadow: inset 0 0 0 1px #1A73E8;
}

/* Show checkmark when selected */
.product-radio:checked + .product-card::before {
    opacity: 1;
}

.product-radio:checked + .product-card::after {
    opacity: 1;
}

.product-option:hover .product-radio:checked + .product-card {
    outline: 2px solid #1A73E8 !important;
    background-color: rgba(26, 115, 232, 0.15);
    /* Use inset box-shadow for selection indicator */
    box-shadow: inset 0 0 0 1px #1A73E8;
}

/* Keep checkmark visible on hover when selected */
.product-option:hover .product-radio:checked + .product-card::before {
    opacity: 1;
}

.product-option:hover .product-radio:checked + .product-card::after {
    opacity: 1;
}

/* Focus state for product options */
.product-option:focus-within .product-card:not(.selected) {
    outline: 2px solid #1A73E8;
    outline-offset: 0px;
    background-color: rgba(0, 0, 0, 0.05);
    /* Maintain consistent inset box-shadow */
    box-shadow: inset 0 0 0 1px transparent;
}

.product-option:focus-within .product-radio:checked + .product-card {
    outline: 2px solid #1A73E8;
    outline-offset: 0px;
    background-color: rgba(26, 115, 232, 0.1);
    /* Use inset box-shadow for selection indicator */
    box-shadow: inset 0 0 0 1px #1A73E8;
}

/* Keep checkmark visible on focus when selected */
.product-option:focus-within .product-radio:checked + .product-card::before {
    opacity: 1;
}

.product-option:focus-within .product-radio:checked + .product-card::after {
    opacity: 1;
}

/* Back button styles */
#backButton {
    background-color: transparent !important;
    border: none !important;
    color: #212529 !important;
}

#backButton:hover {
    background-color: transparent !important;
    border: none !important;
}

#backButton:focus {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Button disabled state */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive Progress Bar */
@media (max-width: 768px) {
    .step-line {
        width: 320px;
        height: 12px;
    }
    
    .step-text {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .step-line {
        width: 240px;
        height: 10px;
    }
    
    .step-text {
        font-size: 0.75rem;
    }
}

/* Error message styles */
.validation-error {
    color: #dc3545;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.5rem;
    text-align: center;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.validation-error.show {
    opacity: 1;
    transform: translateY(0);
}

/* Button styles from starter-p39q */
.btn-primary {
    background-color: #1A73E8;
    border-color: #1A73E8;
}

.btn-primary:hover {
    background-color: #3b86e8;
    border-color: #3b86e8;
}

/* Keep button bright after click */
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.5) !important;
}

/* Paste Cards (Step 2) - Same styles as Product Cards */
.paste-card {
    transition: outline-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
    border: none !important;
    outline: 1px solid #ababab !important;
    background-color: white !important;
    cursor: pointer;
    /* Prevent layout shift */
    box-sizing: border-box;
    will-change: outline-color, background-color;
    /* Use inset box-shadow for selection indicator without layout shift */
    box-shadow: inset 0 0 0 1px transparent;
}

/* Selection checkmark indicator */
.paste-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-top: 35px solid #1A73E8;
    border-left: 35px solid transparent;
    z-index: 10;
    opacity: 0;
}

.paste-card::after {
    content: '✓';
    font-family: inherit;
    font-weight: 700;
    position: absolute;
    top: 3px;
    right: 4px;
    color: white;
    font-size: 14px;
    z-index: 11;
    opacity: 0;
}

/* Background color for image section */
.paste-card .col-4 {
    background-color: #e0e0e0;
}

.paste-card img {
    object-fit: contain;
    object-position: top;
    width: 100%;
    height: 200px;
    min-height: 200px;
    display: block;
    border-radius: 0.375rem 0 0 0.375rem;
    margin: 1px;
    width: calc(100% - 2px);
    height: calc(200px - 2px);
    min-height: calc(200px - 2px);
}

.paste-card .card-body {
    padding: 1rem;
}

/* Hover state for paste options */
.paste-option:hover .paste-card {
    outline-color: rgba(0, 0, 0, 0.4) !important;
    background-color: rgba(0, 0, 0, 0.05);
    /* Maintain consistent inset box-shadow */
    box-shadow: inset 0 0 0 1px transparent;
}

/* Selected state for paste options */
.paste-radio:checked + .paste-card {
    outline: 2px solid #1A73E8 !important;
    background-color: rgba(26, 115, 232, 0.1);
    /* Use inset box-shadow for selection indicator */
    box-shadow: inset 0 0 0 1px #1A73E8;
}

/* Show checkmark when selected */
.paste-radio:checked + .paste-card::before {
    opacity: 1;
}

.paste-radio:checked + .paste-card::after {
    opacity: 1;
}

.paste-option:hover .paste-radio:checked + .paste-card {
    outline: 2px solid #1A73E8 !important;
    background-color: rgba(26, 115, 232, 0.15);
    /* Use inset box-shadow for selection indicator */
    box-shadow: inset 0 0 0 1px #1A73E8;
}

/* Keep checkmark visible on hover when selected */
.paste-option:hover .paste-radio:checked + .paste-card::before {
    opacity: 1;
}

.paste-option:hover .paste-radio:checked + .paste-card::after {
    opacity: 1;
}

/* Focus state for paste options */
.paste-option:focus-within .paste-card:not(.selected) {
    outline: 2px solid #1A73E8;
    outline-offset: 0px;
    background-color: rgba(0, 0, 0, 0.05);
    /* Maintain consistent inset box-shadow */
    box-shadow: inset 0 0 0 1px transparent;
}

.paste-option:focus-within .paste-radio:checked + .paste-card {
    outline: 2px solid #1A73E8;
    outline-offset: 0px;
    background-color: rgba(26, 115, 232, 0.1);
    /* Use inset box-shadow for selection indicator */
    box-shadow: inset 0 0 0 1px #1A73E8;
}

/* Keep checkmark visible on focus when selected */
.paste-option:focus-within .paste-radio:checked + .paste-card::before {
    opacity: 1;
}

.paste-option:focus-within .paste-radio:checked + .paste-card::after {
    opacity: 1;
}

/* Mobile adjustments for paste cards */
@media (max-width: 767.98px) {
    .paste-card img {
        height: 150px;
        min-height: 150px;
        height: calc(150px - 2px);
        min-height: calc(150px - 2px);
    }
    
    .paste-card .card-body {
        padding: 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .paste-card img {
        height: 120px;
        min-height: 120px;
        height: calc(120px - 2px);
        min-height: calc(120px - 2px);
    }
    
    .paste-card .card-body {
        padding: 0.5rem;
    }
}

/* Comparison table wrapper animation */
#comparisonTableWrapper {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Comparison table styles */
.shoobox-comparison-table {
    width: 100%;
    table-layout: fixed;
}

.shoobox-comparison-table th,
.shoobox-comparison-table td {
    padding: 10px;
    border: none;
    vertical-align: top;
    text-align: center;
}

.shoobox-comparison-table th {
    background: none;
    font-weight: normal;
    text-transform: none !important;
}

.shoobox-comparison-table th h3 {
    text-transform: none !important;
}

/* Ensure equal column widths */
.shoobox-comparison-table th:nth-child(1),
.shoobox-comparison-table th:nth-child(2),
.shoobox-comparison-table th:nth-child(3),
.shoobox-comparison-table td:nth-child(1),
.shoobox-comparison-table td:nth-child(2),
.shoobox-comparison-table td:nth-child(3) {
    width: 33.33%;
}

.table-responsive {
    overflow-x: auto;
}
