/* Product Detail Layout */
.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 30px;
    align-items: start;
}

@media (max-width: 991px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Form Styles */
.config-section {
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 25px;
}

.config-section:last-child {
    border: none;
    padding-bottom: 0;
}

.config-section-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Option selectors */
.options-group-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pill-option {
    border: 1px solid var(--border-color);
    background-color: #f1f5f9;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.pill-option:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.pill-option.selected {
    background: var(--gradient-primary);
    border-color: transparent;
    color: #fff;
    box-shadow: var(--gradient-glow);
}

/* Image options (shapes selection) */
.options-group-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 15px;
}

.image-option-card {
    border: 1px solid var(--border-color);
    background-color: #f8fafc;
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.image-option-card:hover {
    border-color: var(--primary);
}

.image-option-card.selected {
    border-color: var(--primary);
    background-color: rgba(13, 110, 253, 0.08);
    box-shadow: var(--gradient-glow);
}

.image-option-thumb {
    width: 60px;
    height: 60px;
    object-fit: contain;
    opacity: 0.7;
    transition: var(--transition);
}

.image-option-card.selected .image-option-thumb {
    opacity: 1;
}

.image-option-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.image-option-card.selected .image-option-label {
    color: var(--text-primary);
}

/* Dropdown styling */
.select-classic {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.select-classic:focus {
    border-color: var(--primary);
    box-shadow: var(--gradient-glow);
}

.select-classic option {
    background-color: var(--bg-main);
    color: var(--text-primary);
}

/* Tabs for Design Options */
.design-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.design-tab-btn {
    flex: 1;
    text-align: center;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.design-tab-btn:hover {
    color: var(--text-primary);
}

.design-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.design-tab-content {
    display: none;
}

.design-tab-content.active {
    display: block;
}

/* File upload container */
.file-upload-zone {
    border: 2px dashed var(--border-color);
    background-color: #f8fafc;
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.file-upload-zone:hover {
    border-color: var(--primary);
    background-color: #f1f5f9;
}

.file-upload-icon {
    font-size: 32px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.file-upload-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.file-upload-input {
    display: none;
}

/* Template Grid inside Product details */
.templates-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.template-item-card {
    border: 1px solid var(--border-color);
    background-color: #f8fafc;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.template-item-card:hover {
    border-color: var(--primary);
}

.template-item-card.selected {
    border-color: var(--primary);
    box-shadow: var(--gradient-glow);
}

.template-item-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.template-item-name {
    padding: 8px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.template-item-card.selected .template-item-name {
    color: #fff;
    background-color: var(--primary);
}

.template-item-download {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(15, 23, 42, 0.8);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #fff;
    z-index: 2;
}

.template-item-download:hover {
    background-color: var(--primary);
}

/* Template Preview Panel & Overlay inputs */
.template-customization-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    background-color: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 15px;
}

@media (max-width: 576px) {
    .template-customization-box {
        grid-template-columns: 1fr;
    }
}

.preview-container {
    position: relative;
    width: 100%;
    aspect-ratio: 9/5.4; /* standard card ratio */
    background-color: #cbd5e1;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-template-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
}

.preview-text-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15px;
    gap: 8px;
    pointer-events: none;
}

.preview-line {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.input-group-custom {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-classic {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
}

.input-classic:focus {
    border-color: var(--primary);
}

/* Sticky Sidebar (Order card) */
.sticky-sidebar {
    position: sticky;
    top: 75px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-summary-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px 20px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.03), 0 2px 4px -2px rgba(0,0,0,0.03);
}

.order-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.order-summary-row.total-row {
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    margin-bottom: 12px;
    margin-top: 5px;
}

.row-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.row-val {
    font-size: 14px;
    font-weight: 600;
}

.row-val.total-val {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.promo-apply-box {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.promo-input {
    flex: 1;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 50px;
    font-size: 12px;
    color: var(--text-primary);
    text-transform: uppercase;
}

.promo-input:focus {
    border-color: var(--primary);
}

.btn-promo-apply {
    background-color: #f1f5f9;
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-promo-apply:hover {
    border-color: var(--primary);
    background-color: rgba(13, 110, 253, 0.1);
}

/* Sidebar Product Gallery */
.product-gallery {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: #ffffff;
    padding: 10px;
}

.gallery-main-container {
    width: 100%;
    height: 135px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8fafc;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.gallery-main-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: var(--transition);
}

.gallery-thumbnails {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-top: 10px;
    padding-bottom: 4px;
}

/* Customize thin scrollbars for thumbnails list */
.gallery-thumbnails::-webkit-scrollbar {
    height: 4px;
}
.gallery-thumbnails::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}
.gallery-thumbnails::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.gallery-thumbnails::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.thumb-item {
    width: 50px;
    height: 38px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8fafc;
}

.thumb-item:hover {
    border-color: var(--primary);
}

.thumb-item.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.thumb-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Lightbox Modal for Product Gallery */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.lightbox-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content-wrapper {
    position: relative;
    max-width: 90%;
    max-height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.lightbox-modal.show .lightbox-img {
    transform: scale(1);
}

.lightbox-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s ease;
    z-index: 100000;
}

.lightbox-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
    color: #ffffff;
}

.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.2s ease;
    z-index: 100000;
    user-select: none;
}

.lightbox-nav-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.1);
    color: #ffffff;
}

.lightbox-prev-btn {
    left: 20px;
}

.lightbox-next-btn {
    right: 20px;
}

.lightbox-caption {
    margin-top: 20px;
    color: #f8fafc;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Cursor style for main image zoom */
.gallery-main-img {
    cursor: zoom-in !important;
}

