/* 
 * Shop List & Detail Page Styles (designkits style)
 * For Printown Template Gallery
 */

/* ========================================
   Shop List Page
======================================== */

.shop-header {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    padding: 60px 20px;
    text-align: center;
    color: white;
}

.shop-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    word-break: break-all;
    margin-bottom: 10px;
}

.shop-header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

.shop-search-box {
    max-width: 600px;
    margin: 30px auto 0;
    display: flex;
    gap: 10px;
}

.shop-search-box input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
}

.shop-search-box button {
    padding: 15px 30px;
    background: #1e293b;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

/* Filter Section */
.shop-filters {
    background: #f8fafc;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.shop-filters-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.filter-count {
    font-weight: 600;
    color: #1e293b;
    margin-right: 20px;
}

.filter-count span {
    color: #6366f1;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.filter-chip {
    display: inline-block;
    padding: 8px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-chip:hover,
.filter-chip.active {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
}

.filter-selects {
    display: flex;
    gap: 10px;
}

.filter-selects select {
    padding: 10px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #475569;
    cursor: pointer;
}

/* Template Grid */
.shop-grid-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

@media (max-width: 1200px) {
    .shop-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .shop-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .shop-grid {
        grid-template-columns: 1fr;
    }
}

/* Template Card */
.template-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.template-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.template-card-thumb {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f1f5f9;
}

.template-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.template-card:hover .template-card-thumb img {
    transform: scale(1.05);
}

.template-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.9);
    color: white;
    font-size: 0.75rem;
    border-radius: 4px;
    font-weight: 500;
}

.template-card-wish {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 1.1rem;
}

.template-card-wish:hover {
    background: #ef4444;
    color: white;
}

.template-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    display: flex;
    gap: 10px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
}

.template-card:hover .template-card-overlay {
    opacity: 1;
    transform: translateY(0);
}

.template-card-overlay a {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.template-card-overlay .btn-demo {
    background: white;
    color: #1e293b;
}

.template-card-overlay .btn-detail {
    background: #6366f1;
    color: white;
}

.template-card-info {
    padding: 16px;
}

.template-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.template-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.template-card-cms {
    display: flex;
    gap: 6px;
}

.template-card-cms span {
    padding: 3px 8px;
    background: #f1f5f9;
    border-radius: 4px;
    font-size: 0.7rem;
    color: #64748b;
}

.template-card-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #6366f1;
}

.template-card-price.free {
    color: #10b981;
}

.template-card-stats {
    display: flex;
    gap: 15px;
    color: #94a3b8;
    font-size: 0.8rem;
}

/* ========================================
   Shop Detail Page
======================================== */

.shop-detail {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.shop-detail-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
}

@media (max-width: 900px) {
    .shop-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Left: Preview */
.shop-detail-preview {
    background: #f8fafc;
    border-radius: 12px;
    overflow: hidden;
}

.shop-detail-main-image {
    aspect-ratio: 16/10;
    background: #e2e8f0;
}

.shop-detail-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-detail-thumbs {
    display: flex;
    gap: 10px;
    padding: 15px;
    overflow-x: auto;
}

.shop-detail-thumbs img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.shop-detail-thumbs img:hover,
.shop-detail-thumbs img.active {
    opacity: 1;
}

/* Right: Purchase Box */
.shop-detail-purchase {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 30px;
    position: sticky;
    top: 20px;
}

.shop-detail-title {
    font-size: 1.5rem;
    font-weight: 700;
    word-break: break-all;
    color: #1e293b;
    margin-bottom: 10px;
}

.shop-detail-code {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.shop-detail-options {
    margin-bottom: 25px;
}

.option-group {
    margin-bottom: 20px;
}

.option-group label {
    display: block;
    font-weight: 600;
    color: #475569;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-item:hover {
    border-color: #6366f1;
}

.option-item.selected {
    border-color: #6366f1;
    background: #f0f0ff;
}

.option-item input {
    margin-right: 12px;
}

.option-item .name {
    flex: 1;
    font-weight: 500;
    color: #1e293b;
}

.option-item .price {
    font-weight: 600;
    color: #6366f1;
}

.option-item .price.free {
    color: #10b981;
}

/* Price Summary */
.price-summary {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #64748b;
}

.price-row.total {
    border-top: 1px solid #e2e8f0;
    padding-top: 15px;
    margin-top: 15px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
}

.price-row.total .value {
    color: #6366f1;
}

/* Buttons */
.btn-purchase {
    width: 100%;
    padding: 16px;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-purchase:hover {
    background: #4f46e5;
}

.btn-demo-link {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: #64748b;
    font-size: 0.95rem;
}

.btn-demo-link:hover {
    color: #6366f1;
}

/* Tabs */
.shop-detail-tabs {
    margin-top: 50px;
}

.shop-tabs-nav {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    gap: 5px;
}

.shop-tabs-nav button {
    padding: 15px 25px;
    background: none;
    border: none;
    font-size: 1rem;
    color: #64748b;
    cursor: pointer;
    position: relative;
    font-weight: 500;
}

.shop-tabs-nav button.active {
    color: #6366f1;
}

.shop-tabs-nav button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #6366f1;
}

.shop-tab-content {
    padding: 30px 0;
}

/* Related Products */
.related-products {
    margin-top: 60px;
}

.related-products h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: #1e293b;
}

/* Main Page Sections */
.shop-main-wrap {
    padding: 40px 0;
}

.main-section {
    margin-bottom: 60px;
}

.section-header {
    text-align: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #111;
}

.section-header h2 a {
    color: inherit;
    text-decoration: none;
}

.section-header p {
    color: #666;
    font-size: 1rem;
}

/* ========================================
   Item Source Detail Page Adjustments
   ======================================== */

/* Dark Header for Detail Page */
.shop-header.detail-page {
    background: linear-gradient(135deg, #1e293b, #334155);
    padding: 40px 20px;
    color: white;
}

.shop-header.detail-page .inner-wrap {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.shop-header.detail-page h1 {
    font-size: 2rem;
    margin: 0;
    color: white;
}

.shop-header.detail-page p {
    margin: 0;
    opacity: 0.8;
}

/* Base Styles from item_source.php */
.shop-detail-left {}

/* Placeholder for clarity */

.shop-detail-right {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.shop-detail-preview {
    margin-bottom: 40px;
}

.shop-detail-main-image {
    background: #f8fafc;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shop-detail-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-detail-purchase {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.shop-detail-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1e293b;
}

.shop-detail-code {
    font-size: 0.85rem;
    word-break: break-all;
    color: #94a3b8;
    margin-bottom: 24px;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .shop-detail-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .shop-detail-right {
        position: static;
    }
}

@media (max-width: 768px) {
    .shop-detail {
        padding: 20px 15px;
    }

    .shop-header.detail-page {
        padding: 30px 15px !important;
    }

    .shop-header.detail-page h1 {
        font-size: 1.5rem !important;
    }

    .btn-purchase,
    .btn-cart {
        font-size: 1rem;
        padding: 15px;
    }

    /* Option Item Mobile Layout */
    .option-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
    }

    .option-item input {
        margin-bottom: 8px;
    }

    .option-item .name {
        width: 100%;
        margin-bottom: 8px;
        font-size: 0.95rem;
        line-height: 1.4;
        word-break: break-all;
    }

    .option-item .price {
        align-self: flex-end;
        font-size: 1rem;
    }
}