@charset "UTF-8";

/* ==========================================
   Base & Reset
   ========================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    padding-bottom: 40px;
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 15px;
}

/* ==========================================
   Header & Navigation
   ========================================== */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.top-nav h1 {
    font-size: 1.4rem;
    color: #222;
}

.top-nav-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #666;
}

/* Category Filter Tags */
.category-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.cat-btn {
    padding: 8px 16px;
    background: #e9ecef;
    color: #495057;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.cat-btn.active, .cat-btn:hover {
    background: #007bff;
    color: #fff;
    text-decoration: none;
}

/* ==========================================
   Product Grid & Cards (index.php)
   ========================================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.product-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.card-img-link {
    display: block;
    height: 200px;
    background: #fff;
    overflow: hidden;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-bottom: 1px solid #edf2f7;
}

.card-body {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-badge {
    display: inline-block;
    background: #6c757d;
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.card-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.card-title a {
    color: #2d3748;
}

.card-price {
    font-size: 1.25rem;
    color: #e53e3e;
    font-weight: bold;
    margin-bottom: 12px;
}

/* ==========================================
   Product Detail (detail.php)
   ========================================== */
.product-detail-container {
    display: flex;
    gap: 40px;
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.gallery {
    flex: 1;
    min-width: 300px;
}

.main-image img {
    width: 100%;
    height: 380px;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 6px;
    background: #fff;
}

.thumbnails {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.thumbnails img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}

.thumbnails img:hover {
    border-color: #007bff;
    opacity: 0.8;
}

.product-info {
    flex: 1;
    min-width: 300px;
}

.product-info h1 {
    font-size: 1.6rem;
    margin-bottom: 10px;
}

.product-info .price {
    font-size: 2rem;
    color: #e53e3e;
    font-weight: bold;
    margin: 15px 0;
}

.product-info .description {
    line-height: 1.7;
    color: #4a5568;
    margin-bottom: 25px;
    white-space: pre-wrap;
}

/* ==========================================
   Forms, Tables & Buttons
   ========================================== */
.form-card {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    max-width: 650px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    background: #fff;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary { background: #007bff; color: #fff; }
.btn-primary:hover { background: #0056b3; text-decoration: none; }
.btn-success { background: #28a745; color: #fff; }
.btn-success:hover { background: #1e7e34; text-decoration: none; }
.btn-secondary { background: #6c757d; color: #fff; }
.btn-secondary:hover { background: #545b62; text-decoration: none; }
.btn-danger { background: #dc3545; color: #fff; }
.btn-danger:hover { background: #bd2130; text-decoration: none; }
.btn-block { display: block; width: 100%; }

/* Responsive Table Scroll Container */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th, td {
    padding: 12px 15px;
    border-bottom: 1px solid #edf2f7;
    text-align: left;
    vertical-align: middle;
}

th {
    background: #f7fafc;
    font-weight: bold;
}

.thumb-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

/* Login Page Spec */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-box {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.error-msg {
    background: #fff5f5;
    color: #e53e3e;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #fed7d7;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

/* ==========================================
   Mobile Responsive Adjustments (Max 768px)
   ========================================== */
@media (max-width: 768px) {
    .top-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .top-nav-links {
        width: 100%;
        justify-content: space-between;
    }

    .product-detail-container {
        flex-direction: column;
        padding: 15px;
        gap: 20px;
    }

    .main-image img {
        height: 280px;
    }

    .thumbnails {
        grid-template-columns: repeat(5, 1fr);
    }

    .thumbnails img {
        height: 50px;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .card-img-link {
        height: 140px;
    }

    .card-body {
        padding: 10px;
    }

    .card-title {
        font-size: 0.95rem;
    }

    .card-price {
        font-size: 1.1rem;
    }

    .btn {
        padding: 12px; /* スマホでの誤タップ防止のためボタン高さを確保 */
    }
}