/* Product Styles - Shop & Product Detail Pages */

/* Shop Layout */
.shop-section {
    padding: 4rem 0;
    min-height: 80vh;
}

.shop-header {
    margin-bottom: 3rem;
    text-align: center;
}

.shop-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-foreground);
    margin-bottom: 1rem;
}

.shop-subtitle {
    color: var(--color-muted-foreground);
    max-width: 600px;
    margin: 0 auto;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
}

@media (min-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Product Card */
.product-card {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative; /* Needed for badge positioning if we want it outside container */
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
    box-shadow: 0 10px 30px -10px rgba(250, 204, 21, 0.15);
}

.product-image-container {
    position: relative;
    padding-top: 100%;
    /* 1:1 Aspect Ratio */
    background-color: transparent;
    overflow: hidden;
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 0;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.badge-coming-soon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: var(--color-primary);
    color: var(--color-background);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 10;
}

.product-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.product-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-foreground);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-foreground);
    margin-top: auto;
    padding-top: 1rem;
}

.product-actions {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
}

.btn-add-cart {
    background-color: var(--color-primary);
    color: var(--color-background);
    border: none;
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: 0.75rem;
    transition: background-color 0.2s;
    width: 100%;
    /* Ensure full width on mobile */
}

.btn-add-cart:disabled {
    background-color: var(--color-muted);
    color: var(--color-muted-foreground);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-add-cart:disabled:hover {
    background-color: var(--color-muted);
}

.continue-shopping {
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius-md);
    font-weight: 600;
}

@media (min-width: 640px) {
    .btn-add-cart {
        width: auto;
    }
}

.btn-add-cart:hover {
    background-color: var(--color-primary);
}

.btn-view-details {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: var(--color-foreground);
}

.btn-view-details:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}


/* ========================================================================== */
/* PRODUCT DETAIL PAGE STYLES                                                 */
/* ========================================================================== */

.product-detail-section {
    padding: 2rem 0 4rem;
    min-height: 80vh;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-muted-foreground);
    font-size: 0.875rem;
    margin-bottom: 2rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--color-primary);
}

.product-detail-grid {
    display: grid;
    gap: 3rem;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .product-detail-grid {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }
}

/* Left Column: Gallery */
.product-gallery {
    position: relative;
}

.main-image-container {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1/1;
}

.main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Image Badge */
.purity-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: rgba(20, 20, 20, 0.9);
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 10;
}

/* Right Column: Info */
.product-main-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Header & Stock Status */
.product-header {
    border-bottom: none;
    padding-bottom: 0.5rem;
}

.product-badge {
    color: var(--color-muted-foreground);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
}

.product-heading {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #ffffff;
}

.product-price-large {
    font-size: 1.5rem;
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

.stock-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #4ade80;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    background-color: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
}

.product-actions-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

@media (min-width: 640px) {
    .product-actions-area {
        flex-direction: row;
    }
}

.quantity-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--color-input);
    border-radius: var(--radius-md);
    height: 3rem;
}

.qty-btn {
    width: 3rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--color-muted-foreground);
}

.qty-btn:hover {
    color: var(--color-foreground);
    background-color: rgba(255, 255, 255, 0.05);
}

#qty-input {
    width: 3rem;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--color-foreground);
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    -moz-appearance: textfield;
}

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

.btn-add-cart-large {
    width: 100%;
    background-color: var(--color-primary);
    color: var(--color-background);
    border: none;
    font-weight: 600;
    padding: 0.875rem;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.btn-add-cart-large:hover {
    filter: brightness(1.1);
}

/* Trust Badges - Updated Layout */
.product-trust-badges {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    border-top: none;
    padding-top: 0;
}

.trust-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.trust-item svg {
    color: var(--color-primary);
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.1rem;
}

.trust-item strong {
    display: block;
    color: #ffffff;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.trust-desc {
    display: block;
    color: var(--color-muted-foreground);
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Product Details Grid Layout */
.product-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    margin-top: 4rem;
}

@media (min-width: 1024px) {
    .product-details-grid {
        grid-template-columns: 3fr 2fr;
        align-items: start;
    }
}

.detail-section {
    margin-bottom: 3rem;
}

.detail-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1rem;
}

.icon-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon-title svg {
    color: var(--color-primary);
}

.detail-text {
    color: var(--color-muted-foreground);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.disclaimer {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 1rem;
}

/* Profile & Findings Cards */
.profile-card, .findings-card {
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 1.5rem;
}

.profile-item, .finding-item {
    margin-bottom: 1.5rem;
}

.profile-label, .finding-title {
    color: var(--color-primary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.profile-value, .finding-desc {
    color: var(--color-muted-foreground);
    font-size: 0.95rem;
}

.finding-source {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--color-muted-foreground);
    opacity: 0.8;
}

/* Right Column Cards (COA & Specs) */
.spec-card {
    background-color: rgba(20, 20, 20, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.spec-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.spec-row:last-child {
    margin-bottom: 0;
}

.spec-label {
    color: var(--color-muted-foreground);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.spec-value {
    color: #ffffff;
    font-family: monospace;
    font-weight: 600;
}

.spec-value.highlight {
    color: #ffffff;
}

.spec-value.success {
    color: #4ade80;
}

/* COA Card */
.coa-card {
    background-color: rgba(20, 20, 20, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.coa-preview-container {
    padding: 1rem;
    background-color: #ffffff;
    height: 250px;
    overflow: hidden;
    position: relative;
}

.coa-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    opacity: 0.9;
}

.coa-info-bar {
    padding: 0.75rem 1rem;
    background-color: rgba(30, 30, 30, 1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.batch-details {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    font-family: monospace;
    font-size: 0.7rem;
}

.batch-id {
    color: #ffffff;
    font-weight: 700;
}

.batch-status-text {
    color: #4ade80;
}

.btn-view-pdf-small {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: none;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-view-pdf-small:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* ========================================================================== */
/* FULL WIDTH COA SECTION                                                     */
/* ========================================================================== */

.coa-full-width-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Certificate of Analysis */
.coa-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 800px;
    /* Constrain width for readability even in full width container */
    margin-left: 0;
    /* Keep aligned left */
}

/* Desktop: Allow COA to be wider or grid if desired, but keeping it stacked is fine. 
   If user wants it full width of container, remove max-width or set to 100% */
@media (min-width: 1024px) {
    .coa-section {
        max-width: 100%;
        /* Use full container width on desktop */
        display: grid;
        grid-template-columns: 1fr 1fr;
        /* Two column layout for info boxes? */
        /* Actually, let's keep the stacked look for the info boxes but maybe side-by-side */
        grid-template-areas:
            "header header"
            "chem purity"
            "image image";
        gap: 1.5rem;
    }

    .coa-header {
        grid-area: header;
    }

    .chemical-info-box {
        grid-area: chem;
    }

    .purity-report-box {
        grid-area: purity;
    }

    .coa-image-container {
        grid-area: image;
    }
}

.coa-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.batch-info {
    font-size: 0.8rem;
    font-family: monospace;
    line-height: 1.4;
    color: var(--color-foreground);
}

.batch-status {
    margin-top: 0.25rem;
}

.status-passed {
    color: #4ade80;
    /* Green-400 */
    font-weight: bold;
}

.btn-view-pdf {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-view-pdf:hover {
    background-color: var(--color-primary);
    color: var(--color-primary-foreground);
}

.chemical-info-box {
    background-color: #000000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
}

/* Optional watermark background effect */
.info-bg-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background-image: url('../images/logo_cropped.png');
    /* Assuming logo exists */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.05;
    pointer-events: none;
}

.chem-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-foreground);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.chem-row {
    margin-bottom: 1.25rem;
    position: relative;
    z-index: 1;
}

.chem-row:last-child {
    margin-bottom: 0;
}

.chem-label {
    font-size: 0.7rem;
    color: var(--color-muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.chem-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-foreground);
    font-family: var(--font-sans);
}

.purity-report-box {
    background-color: #000000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: var(--radius-md);
}

.report-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.report-row:last-child {
    border-bottom: none;
}

.report-label {
    color: var(--color-muted-foreground);
    font-size: 0.9rem;
}

.report-value {
    color: var(--color-foreground);
    font-weight: 600;
    font-family: monospace;
}

.status-match {
    color: #4ade80;
    /* Green-400 */
}

.coa-image-container {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.05);
}

.coa-image {
    width: 100%;
    height: auto;
    display: block;
}
