/* Products Page Styling - Following Auth.css patterns */

/* Container */
.products-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: calc(100vh - 200px);
}

/* Header */
.products-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

@media (min-width: 768px) {
    .products-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.products-header h1 {
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    margin: 0;
}

@media (min-width: 768px) {
    .products-header h1 {
        font-size: 1.8rem;
    }
}

.products-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.products-header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Buttons - Auth.css secondary style */
.products-btn {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 0;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.products-btn:hover {
    border-color: var(--text-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.products-btn.active,
.products-btn.primary {
    background: var(--text-color);
    color: var(--background);
    border-color: var(--text-color);
}

.products-btn.active:hover,
.products-btn.primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

/* Select */
.products-select {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.75rem 2rem 0.75rem 1rem;
    border-radius: 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

:root[class~="dark"] .products-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23cccccc' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.products-select:focus {
    outline: none;
    border-color: var(--text-color);
}

/* Layout */
.products-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

/* Grid */
.products-grid {
    display: grid;
    gap: 0.75rem;
    flex-grow: 1;
    grid-template-columns: repeat(2, 1fr);
}

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

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

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

/* Product Card */
.product-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.2s;
}

.product-card:hover {
    border-color: var(--text-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.product-card-image {
    position: relative;
    aspect-ratio: 4/3;
    width: 100%;
    overflow: hidden;
    background: var(--input-bg);
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.product-card-badge {
    position: absolute;
    top: 0.35rem;
    left: 0.35rem;
    padding: 0.15rem 0.4rem;
    font-size: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #fff;
    z-index: 2;
    border-radius: 9999px;
}

@media (min-width: 768px) {
    .product-card-badge {
        top: 0.75rem;
        left: 0.75rem;
        padding: 0.35rem 0.75rem;
        font-size: 0.65rem;
        letter-spacing: 0.5px;
    }
}

.product-card-discount {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    background: #ef4444;
    color: #fff;
    padding: 0.15rem 0.35rem;
    font-size: 0.5rem;
    font-weight: 700;
    z-index: 2;
    border-radius: 9999px;
}

@media (min-width: 768px) {
    .product-card-discount {
        top: 0.75rem;
        right: 0.75rem;
        padding: 0.35rem 0.5rem;
        font-size: 0.65rem;
    }
}

.product-card-content {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

@media (min-width: 768px) {
    .product-card-content {
        padding: 1rem;
    }
}

.product-card-condition {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.product-card-title {
    font-weight: 700;
    font-size: 0.8rem;
    line-height: 1.3;
    margin-bottom: 0.4rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (min-width: 768px) {
    .product-card-title {
        font-size: 0.9rem;
        line-height: 1.4;
        margin-bottom: 0.5rem;
    }
}

.product-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.product-card-title a:hover {
    color: var(--accent);
}

.product-card-footer {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.product-card-price {
    display: flex;
    flex-direction: column;
}

.product-card-price-original {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-decoration: line-through;
}

.product-card-price-current {
    font-size: 0.95rem;
    font-weight: 900;
}

@media (min-width: 768px) {
    .product-card-price-current {
        font-size: 1.1rem;
    }
}

.product-card-price-current.discount {
    color: #ef4444;
}

.product-card-stock {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.35rem 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Pagination */
.products-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.pagination-btn {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover {
    border-color: var(--text-color);
}

.pagination-btn.active {
    background: var(--text-color);
    color: var(--background);
    border-color: var(--text-color);
}

/* Empty State */
.products-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.products-empty h3 {
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.products-empty p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

/* Loading Skeleton */
.product-skeleton {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    aspect-ratio: 4/5;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Detail Page */
.product-detail-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.product-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 2rem;
    transition: color 0.2s;
}

.product-detail-back:hover {
    color: var(--text-color);
}

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

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

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

.product-gallery-main {
    position: relative;
    aspect-ratio: 1;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.product-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.product-gallery:hover .gallery-nav-btn {
    opacity: 1;
}

.gallery-nav-btn:hover {
    border-color: var(--text-color);
}

.gallery-nav-btn.prev {
    left: 0.75rem;
}

.gallery-nav-btn.next {
    right: 0.75rem;
}

.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.gallery-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--border-color);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.gallery-dot.active {
    background: var(--text-color);
    transform: scale(1.25);
}

/* Info Section */
.product-info {
    display: flex;
    flex-direction: column;
}

.product-info-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    margin-bottom: 1rem;
    align-self: flex-start;
}

.product-info-title {
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .product-info-title {
        font-size: 2rem;
    }
}

.product-info-price {
    margin-bottom: 1.5rem;
}

.product-info-price-original {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: line-through;
    margin-right: 0.5rem;
}

.product-info-price-current {
    font-size: 2rem;
    font-weight: 900;
}

.product-info-price-current.discount {
    color: #ef4444;
}

.product-info-desc {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.product-info-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 1.5rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.product-info-specs dt {
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.product-info-specs dd {
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
}

.product-info-action {
    margin-top: auto;
}

/* Highlights */
.product-highlights {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.product-highlights-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
}

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

.highlight-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.highlight-icon {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.highlight-title {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.highlight-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Similar Products */
.similar-products {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.similar-products h2 {
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
}

@media (min-width: 1024px) {
    .filter-mobile-btn {
        display: none !important;
    }
}