/**
 * WCA Portal Integration - Public Styles
 * Styles for marketplace grid and product detail pages
 */

/* Error messages */
.wca-error {
    color: #dc3232;
    padding: 15px;
    background: #fef7f7;
    border-left: 4px solid #dc3232;
    margin: 20px 0;
}

/* Badge */
.wca-badge {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

/* Products Section Heading */
.wca-products-heading {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 40px 0 20px 0;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

/* Marketplace Grid */
.wca-marketplace-grid {
    display: grid;
    gap: 24px;
    margin: 30px 0;
}

.wca-marketplace-grid.wca-columns-1 {
    grid-template-columns: 1fr;
}

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

.wca-marketplace-grid.wca-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.wca-marketplace-grid.wca-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .wca-marketplace-grid.wca-columns-4,
    .wca-marketplace-grid.wca-columns-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .wca-marketplace-grid.wca-columns-4,
    .wca-marketplace-grid.wca-columns-3,
    .wca-marketplace-grid.wca-columns-2 {
        grid-template-columns: 1fr;
    }
}

/* Product Card */
.wca-product-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.wca-product-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.wca-product-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.wca-product-image {
    aspect-ratio: 16/9;
    overflow: visible;
    background: #fff;
    padding: 12px;
}

.wca-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wca-product-image-placeholder {
    background: #fff;
}

.wca-product-info {
    padding: 20px;
}

.wca-product-name {
    margin: 0 0 8px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
}

.wca-product-description {
    margin: 0 0 12px 0;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
}

.wca-product-price {
    font-size: 15px;
    line-height: 24px;
    font-weight: 600;
    color: #7E9A47;
}

/* Product Detail Page */
.wca-product-detail {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.wca-product-hero {
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
}

.wca-product-hero-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
}

.wca-product-content {
    padding: 0;
}

.wca-product-title {
    margin: 0 0 8px 0;
}

.wca-product-tagline {
    margin: 0 0 16px 0;
    font-size: 1.25rem;
    color: #6b7280;
    line-height: 1.5;
}

.wca-product-price-large {
    font-size: 15px;
    line-height: 24px;
    font-weight: 600;
    color: #7E9A47;
    margin-bottom: 24px;
}

.wca-product-description-full {
    font-size: 1rem;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 30px;
}

.wca-product-description-full p {
    margin-bottom: 16px;
}

.wca-product-features,
.wca-product-deliverables {
    margin-bottom: 30px;
}

.wca-product-features h3,
.wca-product-deliverables h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 16px 0;
}

.wca-product-features ul,
.wca-product-deliverables ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wca-product-features li,
.wca-product-deliverables li {
    position: relative;
    padding: 8px 0 8px 28px;
    font-size: 1rem;
    color: #374151;
    line-height: 1.5;
}

.wca-product-features li::before,
.wca-product-deliverables li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #7E9A47;
    font-weight: 600;
}

/* Quantity Selector */
.wca-quantity-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 20px;
}

.wca-quantity-selector {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.wca-qty-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    color: #374151;
    transition: background 0.15s ease;
    padding: 0;
    margin: 0;
    line-height: 36px;
    vertical-align: middle;
    box-sizing: border-box;
}

.wca-qty-btn:hover {
    background: #f3f4f6;
}

.wca-qty-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.wca-qty-input {
    width: 36px;
    height: 36px;
    text-align: center;
    border: none !important;
    font-size: 1rem;
    font-weight: 500;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 36px !important;
    vertical-align: middle;
    -moz-appearance: textfield;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

.wca-qty-input::-webkit-outer-spin-button,
.wca-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Buy Button - Green #7E9A47 with white text */
.wca-buy-button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    background: #7E9A47 !important;
    color: #fff !important;
    padding: 16px 48px;
    font-size: 1.125rem;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: 8px;
    transition: background 0.2s ease, transform 0.1s ease;
    text-align: center;
}

.wca-buy-button:hover {
    background: #6b8339 !important;
    color: #fff !important;
    text-decoration: none !important;
}

.wca-buy-button:visited,
.wca-buy-button:active,
.wca-buy-button:focus {
    color: #fff !important;
    text-decoration: none !important;
}

.wca-buy-button:active {
    transform: scale(0.98);
}

/* Back Link */
.wca-back-link {
    display: inline-block;
    color: #6b7280;
    font-size: 0.875rem;
    text-decoration: none;
}

.wca-back-link:hover {
    color: #374151;
    text-decoration: underline;
}

.wca-back-link-top {
    display: block;
    margin-bottom: 20px;
}

/* Product Detail Two-Column Layout */
.wca-product-top-section {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
}

.wca-product-image-col {
    flex: 0 0 50%;
    max-width: 50%;
}

.wca-product-info-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.wca-product-info-col .wca-product-title {
    margin: 0 0 16px 0;
}

.wca-product-info-col .wca-product-price-large {
    margin-bottom: 24px;
}

.wca-product-content-full {
    width: 100%;
}

@media (max-width: 768px) {
    .wca-product-top-section {
        flex-direction: column;
        gap: 24px;
    }
    
    .wca-product-image-col {
        flex: none;
        max-width: 100%;
    }
}

/* Marketplace Header (when synced) */
.wca-marketplace-header {
    margin-bottom: 40px;
}

.wca-marketplace-title {
    margin: 0 0 20px 0;
}

/* Content row: description left, hero image right */
.wca-marketplace-content-row {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.wca-marketplace-description-col {
    flex: 1;
    min-width: 0;
}

.wca-marketplace-description {
    font-size: 1.125rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.6;
}

.wca-marketplace-hero-col {
    flex-shrink: 0;
    text-align: center;
}

.wca-marketplace-hero {
    border-radius: 8px;
    overflow: hidden;
}

.wca-marketplace-hero img {
    display: block;
    width: auto;
    max-width: 250px;
    height: auto;
}

.wca-marketplace-hero a {
    display: block;
}

.wca-marketplace-hero-caption {
    margin: 12px 0 0 0;
    font-size: 0.9rem;
    color: #7E9A47;
    font-weight: 600;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .wca-marketplace-content-row {
        flex-direction: column;
        gap: 24px;
    }
    
    .wca-marketplace-hero-col {
        width: 100%;
    }
    
    .wca-marketplace-hero img {
        max-width: 100%;
    }
}

/* Empty State */
.wca-marketplace-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    background: #f9fafb;
    border-radius: 12px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wca-quantity-row {
        flex-direction: row;
    }
    
    .wca-buy-button {
        text-align: center;
    }
    
    .wca-back-link {
        display: block;
        margin-left: 0;
        text-align: center;
    }
}
