/* --------------------------------------------------
   Quotation Theme UI Styles
-------------------------------------------------- */

:root {
    --theme-color: #3f5d6f;
}

/* Selected corner badge */
.selected-corner-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 25px;
    height: 25px;
    background: var(--theme-color);
    clip-path: polygon(100% 0, 0 0, 100% 100%);
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 2px;
}

.selected-corner-badge i {
    color: white;
    font-size: 12px;
    font-weight: 900;
}

/* Selected border & shadow */
.selected-border {
    border-color: var(--theme-color) !important;
    box-shadow: 0 0 10px color-mix(in srgb, var(--theme-color) 55%, transparent);
}


/* Hover border using transparent default (fix shrinking bug) */
.hover-border-green:hover {
    border-color: var(--theme-color) !important;
}

/* Ensure smooth transitions */
.theme-item,
.plugin-item,
.addon-item {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* --------------------------------------------------
   Additional Card Content Styles (non-breaking)
-------------------------------------------------- */

/* Bottom content area fixed height */
.theme-card-content {
    min-height: 110px;
    /* adjust if needed */
}

/* Title text */
.theme-card-title {
    font-weight: 700;
    text-align: left;
    font-size: 1rem;
    line-height: 1.3;
}

/* Description text */
.theme-card-desc {
    color: #6b7280;
    /* Tailwind gray-500 */
    font-size: 0.875rem;
    /* text-sm */
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* show max 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Demo button */
.theme-demo-btn {
    background: var(--theme-color);
    color: #ffffff;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

/* Price badge (top-right) */
.price-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #f2f2f2;
    color: black;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    z-index: 5;
}

/* zh-TW description clamped */
.theme-desc {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Demo button (slide up from bottom on hover) */
.demo-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--theme-color);
    color: #ffffff;
    text-align: center;
    padding: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 10;
}

.theme-item:hover .demo-btn,
.plugin-item:hover .demo-btn {
    transform: translateY(0);
}

.demo-btn:hover {
    background: color-mix(in srgb, var(--theme-color) 85%, black);
}

/* Demo button from card bottom (new position) */
.demo-btn-card {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--theme-color);
    color: #ffffff;
    text-align: center;
    padding: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.theme-item:hover .demo-btn-card,
.plugin-item:hover .demo-btn-card {
    transform: translateY(0);
}

.demo-btn-card:hover {
    background: color-mix(in srgb, var(--theme-color) 85%, black);
}

/* Card image wrapper for proper positioning */
.card-image-top {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.card-image-top img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --------------------------------------------------
   Extra Services / Addons Styles
-------------------------------------------------- */

/* Quantity input styling */
.addon-quantity {
    border: 2px solid #d1d5db;
    transition: border-color 0.2s ease;
}

.addon-quantity:focus {
    outline: none;
    border-color: var(--theme-color);
}

/* Remove number input arrows */
.addon-quantity::-webkit-outer-spin-button,
.addon-quantity::-webkit-inner-spin-button,
.hosting-variant-quantity::-webkit-outer-spin-button,
.hosting-variant-quantity::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.addon-quantity[type=number],
.hosting-variant-quantity[type=number] {
    -moz-appearance: textfield;
}

/* Quantity +/- buttons */
.quantity-btn-minus,
.quantity-btn-plus {
    user-select: none;
    cursor: pointer;
}

.quantity-btn-minus:active,
.quantity-btn-plus:active {
    transform: scale(0.95);
}

/* Select dropdown styling */
.addon-select {
    border: 2px solid #d1d5db;
    transition: border-color 0.2s ease;
    cursor: pointer;
    min-width: 0; /* Allow flex item to shrink below content size */
}

.addon-select:focus {
    outline: none;
    border-color: var(--theme-color);
}

/* Fix mobile overflow for addon items with select */
@media (max-width: 640px) {
    .addon-item[data-addon-type="select"] > div {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .addon-select {
        width: 100%;
        flex: none;
    }
}

/* Details card slide-up animation */
.details-card {
    animation: slideUp 0.3s ease-out;
    transform-origin: top;
}

.details-card.hidden {
    display: none;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Details card items */
.detail-item {
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.detail-item:last-child {
    border-bottom: none;
}

/* Fixed item styling */
.fixed-item {
    cursor: not-allowed;
}


/* Preserve hidden state after compiling Tailwind ahead of theme CSS. */
.selected-corner-badge.hidden { display: none; }
